Skip to content

Commit

Permalink
[PATCH] skge: TX low water mark definition
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Jun 8, 2006
1 parent d85b514 commit 9db9647
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/net/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#define DEFAULT_TX_RING_SIZE 128
#define DEFAULT_RX_RING_SIZE 512
#define MAX_TX_RING_SIZE 1024
#define TX_LOW_WATER (MAX_SKB_FRAGS + 1)
#define MAX_RX_RING_SIZE 4096
#define RX_COPY_THRESHOLD 128
#define RX_BUF_SIZE 1536
Expand Down Expand Up @@ -401,7 +402,7 @@ static int skge_set_ring_param(struct net_device *dev,
int err;

if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE ||
p->tx_pending < MAX_SKB_FRAGS+1 || p->tx_pending > MAX_TX_RING_SIZE)
p->tx_pending < TX_LOW_WATER || p->tx_pending > MAX_TX_RING_SIZE)
return -EINVAL;

skge->rx_ring.count = p->rx_pending;
Expand Down Expand Up @@ -2394,7 +2395,7 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev)
dev->name, e - ring->start, skb->len);

ring->to_use = e->next;
if (skge_avail(&skge->tx_ring) <= MAX_SKB_FRAGS + 1) {
if (skge_avail(&skge->tx_ring) <= TX_LOW_WATER) {
pr_debug("%s: transmit queue full\n", dev->name);
netif_stop_queue(dev);
}
Expand Down Expand Up @@ -2689,7 +2690,7 @@ static void skge_tx_done(struct skge_port *skge)

skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_IRQ_CL_F);

if (skge_avail(&skge->tx_ring) > MAX_SKB_FRAGS + 1)
if (skge_avail(&skge->tx_ring) > TX_LOW_WATER)
netif_wake_queue(skge->netdev);

spin_unlock(&skge->tx_lock);
Expand Down

0 comments on commit 9db9647

Please sign in to comment.