* [PATCH 0/5] atl1: additional patches for 2.6.23
@ 2007-07-19 23:45 Jay Cliburn
2007-07-19 23:45 ` [PATCH 1/5] atl1: change tpd_avail function name Jay Cliburn
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Jay Cliburn @ 2007-07-19 23:45 UTC (permalink / raw)
To: jeff; +Cc: netdev, linux-kernel, atl1-devel, csnook
Please accept the following patches for the atl1 driver. Thanks.
atl1: use kernel provided ethernet length constants
atl1: fix typo in dma_req_block
atl1: change cmb write threshold
atl1: fix typo in DMA engine setup
atl1: change tpd_avail function name
drivers/net/atl1/atl1_hw.h | 9 ++-------
drivers/net/atl1/atl1_main.c | 26 +++++++++++++++-----------
2 files changed, 17 insertions(+), 18 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/5] atl1: change tpd_avail function name
2007-07-19 23:45 [PATCH 0/5] atl1: additional patches for 2.6.23 Jay Cliburn
@ 2007-07-19 23:45 ` Jay Cliburn
2007-07-24 20:36 ` Jeff Garzik
2007-07-19 23:45 ` [PATCH 2/5] atl1: fix typo in DMA engine setup Jay Cliburn
` (3 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Jay Cliburn @ 2007-07-19 23:45 UTC (permalink / raw)
To: jeff; +Cc: netdev, linux-kernel, atl1-devel, csnook, Jay Cliburn
Change tpd_avail() to atl1_tpd_avail().
Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
---
drivers/net/atl1/atl1_main.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index fd1e156..79d60e1 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -1422,7 +1422,7 @@ static void atl1_intr_tx(struct atl1_adapter *adapter)
netif_wake_queue(adapter->netdev);
}
-static u16 tpd_avail(struct atl1_tpd_ring *tpd_ring)
+static u16 atl1_tpd_avail(struct atl1_tpd_ring *tpd_ring)
{
u16 next_to_clean = atomic_read(&tpd_ring->next_to_clean);
u16 next_to_use = atomic_read(&tpd_ring->next_to_use);
@@ -1708,7 +1708,7 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
return NETDEV_TX_LOCKED;
}
- if (tpd_avail(&adapter->tpd_ring) < count) {
+ if (atl1_tpd_avail(&adapter->tpd_ring) < count) {
/* not enough descriptors */
netif_stop_queue(netdev);
spin_unlock_irqrestore(&adapter->lock, flags);
--
1.5.2.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/5] atl1: fix typo in DMA engine setup
2007-07-19 23:45 [PATCH 0/5] atl1: additional patches for 2.6.23 Jay Cliburn
2007-07-19 23:45 ` [PATCH 1/5] atl1: change tpd_avail function name Jay Cliburn
@ 2007-07-19 23:45 ` Jay Cliburn
2007-07-19 23:45 ` [PATCH 3/5] atl1: change cmb write threshold Jay Cliburn
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Jay Cliburn @ 2007-07-19 23:45 UTC (permalink / raw)
To: jeff; +Cc: netdev, linux-kernel, atl1-devel, csnook, Jay Cliburn
The DMA engine setup contains a typo that can result in an incorrect
dmaw_block setting.
Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
---
drivers/net/atl1/atl1_main.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index 79d60e1..3b8f633 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -908,8 +908,8 @@ static u32 atl1_configure(struct atl1_adapter *adapter)
/* config DMA Engine */
value = ((((u32) hw->dmar_block) & DMA_CTRL_DMAR_BURST_LEN_MASK)
<< DMA_CTRL_DMAR_BURST_LEN_SHIFT) |
- ((((u32) hw->dmaw_block) & DMA_CTRL_DMAR_BURST_LEN_MASK)
- << DMA_CTRL_DMAR_BURST_LEN_SHIFT) | DMA_CTRL_DMAR_EN |
+ ((((u32) hw->dmaw_block) & DMA_CTRL_DMAW_BURST_LEN_MASK)
+ << DMA_CTRL_DMAW_BURST_LEN_SHIFT) | DMA_CTRL_DMAR_EN |
DMA_CTRL_DMAW_EN;
value |= (u32) hw->dma_ord;
if (atl1_rcb_128 == hw->rcb_value)
--
1.5.2.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/5] atl1: change cmb write threshold
2007-07-19 23:45 [PATCH 0/5] atl1: additional patches for 2.6.23 Jay Cliburn
2007-07-19 23:45 ` [PATCH 1/5] atl1: change tpd_avail function name Jay Cliburn
2007-07-19 23:45 ` [PATCH 2/5] atl1: fix typo in DMA engine setup Jay Cliburn
@ 2007-07-19 23:45 ` Jay Cliburn
2007-07-19 23:45 ` [PATCH 4/5] atl1: fix typo in dma_req_block Jay Cliburn
2007-07-19 23:45 ` [PATCH 5/5] atl1: use kernel provided ethernet length constants Jay Cliburn
4 siblings, 0 replies; 7+ messages in thread
From: Jay Cliburn @ 2007-07-19 23:45 UTC (permalink / raw)
To: jeff; +Cc: netdev, linux-kernel, atl1-devel, csnook, Jay Cliburn
Change the threshold number of descriptors used to trigger CMB writes.
The vendor reports that under certain conditions this will reduce the
number of unnecessary tx interrupts and improve rx performance.
This change is lifted directly from vendor version 1.2.40.2 of the L1
driver.
Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
---
drivers/net/atl1/atl1_main.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index 3b8f633..6aa2dc3 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -917,7 +917,10 @@ static u32 atl1_configure(struct atl1_adapter *adapter)
iowrite32(value, hw->hw_addr + REG_DMA_CTRL);
/* config CMB / SMB */
- value = hw->cmb_rrd | ((u32) hw->cmb_tpd << 16);
+ value = (hw->cmb_tpd > adapter->tpd_ring.count) ?
+ hw->cmb_tpd : adapter->tpd_ring.count;
+ value <<= 16;
+ value |= hw->cmb_rrd;
iowrite32(value, hw->hw_addr + REG_CMB_WRITE_TH);
value = hw->cmb_rx_timer | ((u32) hw->cmb_tx_timer << 16);
iowrite32(value, hw->hw_addr + REG_CMB_WRITE_TIMER);
--
1.5.2.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/5] atl1: fix typo in dma_req_block
2007-07-19 23:45 [PATCH 0/5] atl1: additional patches for 2.6.23 Jay Cliburn
` (2 preceding siblings ...)
2007-07-19 23:45 ` [PATCH 3/5] atl1: change cmb write threshold Jay Cliburn
@ 2007-07-19 23:45 ` Jay Cliburn
2007-07-19 23:45 ` [PATCH 5/5] atl1: use kernel provided ethernet length constants Jay Cliburn
4 siblings, 0 replies; 7+ messages in thread
From: Jay Cliburn @ 2007-07-19 23:45 UTC (permalink / raw)
To: jeff; +Cc: netdev, linux-kernel, atl1-devel, csnook, Jay Cliburn
s/dam/dma
Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
---
drivers/net/atl1/atl1_hw.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/atl1/atl1_hw.h b/drivers/net/atl1/atl1_hw.h
index 100c09c..f0d7e82 100644
--- a/drivers/net/atl1/atl1_hw.h
+++ b/drivers/net/atl1/atl1_hw.h
@@ -929,8 +929,8 @@ enum atl1_dma_req_block {
atl1_dma_req_128 = 0,
atl1_dma_req_256 = 1,
atl1_dma_req_512 = 2,
- atl1_dam_req_1024 = 3,
- atl1_dam_req_2048 = 4,
+ atl1_dma_req_1024 = 3,
+ atl1_dma_req_2048 = 4,
atl1_dma_req_4096 = 5
};
--
1.5.2.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/5] atl1: use kernel provided ethernet length constants
2007-07-19 23:45 [PATCH 0/5] atl1: additional patches for 2.6.23 Jay Cliburn
` (3 preceding siblings ...)
2007-07-19 23:45 ` [PATCH 4/5] atl1: fix typo in dma_req_block Jay Cliburn
@ 2007-07-19 23:45 ` Jay Cliburn
4 siblings, 0 replies; 7+ messages in thread
From: Jay Cliburn @ 2007-07-19 23:45 UTC (permalink / raw)
To: jeff; +Cc: netdev, linux-kernel, atl1-devel, csnook, Jay Cliburn
Use constants already provided by the kernel for ethernet related lengths.
Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
---
drivers/net/atl1/atl1_hw.h | 5 -----
drivers/net/atl1/atl1_main.c | 13 +++++++------
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/net/atl1/atl1_hw.h b/drivers/net/atl1/atl1_hw.h
index f0d7e82..939aa0f 100644
--- a/drivers/net/atl1/atl1_hw.h
+++ b/drivers/net/atl1/atl1_hw.h
@@ -680,11 +680,6 @@ void atl1_check_options(struct atl1_adapter *adapter);
#define AUTONEG_ADVERTISE_10_100_ALL 0x000F /* All 10/100 speeds */
#define AUTONEG_ADVERTISE_10_ALL 0x0003 /* 10Mbps Full & Half speeds */
-/* The size (in bytes) of a ethernet packet */
-#define ENET_HEADER_SIZE 14
-#define MAXIMUM_ETHERNET_FRAME_SIZE 1518 /* with FCS */
-#define MINIMUM_ETHERNET_FRAME_SIZE 64 /* with FCS */
-#define ETHERNET_FCS_SIZE 4
#define MAX_JUMBO_FRAME_SIZE 0x2800
#define PHY_AUTO_NEG_TIME 45 /* 4.5 Seconds */
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index 6aa2dc3..993ed2a 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -59,6 +59,7 @@
#include <linux/skbuff.h>
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
+#include <linux/if_ether.h>
#include <linux/irqreturn.h>
#include <linux/workqueue.h>
#include <linux/timer.h>
@@ -120,8 +121,8 @@ static int __devinit atl1_sw_init(struct atl1_adapter *adapter)
struct atl1_hw *hw = &adapter->hw;
struct net_device *netdev = adapter->netdev;
- hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
- hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE;
+ hw->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
+ hw->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
adapter->wol = 0;
adapter->rx_buffer_len = (hw->max_frame_size + 7) & ~7;
@@ -688,9 +689,9 @@ static int atl1_change_mtu(struct net_device *netdev, int new_mtu)
{
struct atl1_adapter *adapter = netdev_priv(netdev);
int old_mtu = netdev->mtu;
- int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
+ int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
- if ((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) ||
+ if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
(max_frame > MAX_JUMBO_FRAME_SIZE)) {
dev_warn(&adapter->pdev->dev, "invalid MTU setting\n");
return -EINVAL;
@@ -1337,7 +1338,7 @@ rrd_ok:
skb = buffer_info->skb;
length = le16_to_cpu(rrd->xsz.xsum_sz.pkt_size);
- skb_put(skb, length - ETHERNET_FCS_SIZE);
+ skb_put(skb, length - ETH_FCS_LEN);
/* Receive Checksum Offload */
atl1_rx_checksum(adapter, rrd, skb);
@@ -1456,7 +1457,7 @@ static int atl1_tso(struct atl1_adapter *adapter, struct sk_buff *skb,
tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
iph->daddr, 0, IPPROTO_TCP, 0);
ipofst = skb_network_offset(skb);
- if (ipofst != ENET_HEADER_SIZE) /* 802.3 frame */
+ if (ipofst != ETH_HLEN) /* 802.3 frame */
tso->tsopl |= 1 << TSO_PARAM_ETHTYPE_SHIFT;
tso->tsopl |= (iph->ihl &
--
1.5.2.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/5] atl1: change tpd_avail function name
2007-07-19 23:45 ` [PATCH 1/5] atl1: change tpd_avail function name Jay Cliburn
@ 2007-07-24 20:36 ` Jeff Garzik
0 siblings, 0 replies; 7+ messages in thread
From: Jeff Garzik @ 2007-07-24 20:36 UTC (permalink / raw)
To: Jay Cliburn; +Cc: netdev, linux-kernel, atl1-devel, csnook
Jay Cliburn wrote:
> Change tpd_avail() to atl1_tpd_avail().
>
> Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
> ---
> drivers/net/atl1/atl1_main.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
applied 1-5
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-07-24 20:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-19 23:45 [PATCH 0/5] atl1: additional patches for 2.6.23 Jay Cliburn
2007-07-19 23:45 ` [PATCH 1/5] atl1: change tpd_avail function name Jay Cliburn
2007-07-24 20:36 ` Jeff Garzik
2007-07-19 23:45 ` [PATCH 2/5] atl1: fix typo in DMA engine setup Jay Cliburn
2007-07-19 23:45 ` [PATCH 3/5] atl1: change cmb write threshold Jay Cliburn
2007-07-19 23:45 ` [PATCH 4/5] atl1: fix typo in dma_req_block Jay Cliburn
2007-07-19 23:45 ` [PATCH 5/5] atl1: use kernel provided ethernet length constants Jay Cliburn
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).