aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/skge.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-06-06 13:11:12 -0400
committerJeff Garzik <jeff@garzik.org>2006-06-08 15:44:54 -0400
commit9db96479b4e682b1bc3796873589db1f8d38a9d5 (patch)
tree67e962fc0c1a1a0d7d9eb51fa6d684bb220ba38a /drivers/net/skge.c
parentd85b514fd9aa95d2089fa16dccc25863fb2a766c (diff)
[PATCH] skge: TX low water mark definition
Consolidate all usage of ring low water mark to one value. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/skge.c')
-rw-r--r--drivers/net/skge.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 55245dbaecbc..7d8e2ab80604 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -50,6 +50,7 @@
50#define DEFAULT_TX_RING_SIZE 128 50#define DEFAULT_TX_RING_SIZE 128
51#define DEFAULT_RX_RING_SIZE 512 51#define DEFAULT_RX_RING_SIZE 512
52#define MAX_TX_RING_SIZE 1024 52#define MAX_TX_RING_SIZE 1024
53#define TX_LOW_WATER (MAX_SKB_FRAGS + 1)
53#define MAX_RX_RING_SIZE 4096 54#define MAX_RX_RING_SIZE 4096
54#define RX_COPY_THRESHOLD 128 55#define RX_COPY_THRESHOLD 128
55#define RX_BUF_SIZE 1536 56#define RX_BUF_SIZE 1536
@@ -401,7 +402,7 @@ static int skge_set_ring_param(struct net_device *dev,
401 int err; 402 int err;
402 403
403 if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE || 404 if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE ||
404 p->tx_pending < MAX_SKB_FRAGS+1 || p->tx_pending > MAX_TX_RING_SIZE) 405 p->tx_pending < TX_LOW_WATER || p->tx_pending > MAX_TX_RING_SIZE)
405 return -EINVAL; 406 return -EINVAL;
406 407
407 skge->rx_ring.count = p->rx_pending; 408 skge->rx_ring.count = p->rx_pending;
@@ -2394,7 +2395,7 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev)
2394 dev->name, e - ring->start, skb->len); 2395 dev->name, e - ring->start, skb->len);
2395 2396
2396 ring->to_use = e->next; 2397 ring->to_use = e->next;
2397 if (skge_avail(&skge->tx_ring) <= MAX_SKB_FRAGS + 1) { 2398 if (skge_avail(&skge->tx_ring) <= TX_LOW_WATER) {
2398 pr_debug("%s: transmit queue full\n", dev->name); 2399 pr_debug("%s: transmit queue full\n", dev->name);
2399 netif_stop_queue(dev); 2400 netif_stop_queue(dev);
2400 } 2401 }
@@ -2689,7 +2690,7 @@ static void skge_tx_done(struct skge_port *skge)
2689 2690
2690 skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_IRQ_CL_F); 2691 skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_IRQ_CL_F);
2691 2692
2692 if (skge_avail(&skge->tx_ring) > MAX_SKB_FRAGS + 1) 2693 if (skge_avail(&skge->tx_ring) > TX_LOW_WATER)
2693 netif_wake_queue(skge->netdev); 2694 netif_wake_queue(skge->netdev);
2694 2695
2695 spin_unlock(&skge->tx_lock); 2696 spin_unlock(&skge->tx_lock);