From: Stephen Hemminger Date: Fri, 9 Dec 2005 19:35:02 +0000 (-0800) Subject: [PATCH] sky2: transmit logic fixes X-Git-Tag: v2.6.16-rc1~474^2~22^2~7^2~32 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e3ff6aab1ff2d093996bd7b8c9c06c3d823855c;p=linux-2.6 [PATCH] sky2: transmit logic fixes Some transmit side small fixes: * When computing number of list elements per transmit, do full comparision to check for checksuming. * Get rid of racy check for tx_complete * Change stop test to match wake condition. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 1eefacbfcd..8dfd27d4d6 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -1051,7 +1051,7 @@ static inline unsigned tx_le_req(const struct sk_buff *skb) if (skb_shinfo(skb)->tso_size) ++count; - if (skb->ip_summed) + if (skb->ip_summed == CHECKSUM_HW) ++count; return count; @@ -1207,7 +1207,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod, &sky2->tx_last_put, TX_RING_SIZE); - if (tx_avail(sky2) < MAX_SKB_TX_LE + 1) + if (tx_avail(sky2) <= MAX_SKB_TX_LE) netif_stop_queue(dev); out_unlock: @@ -1229,8 +1229,7 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done) struct net_device *dev = sky2->netdev; unsigned i; - if (done == sky2->tx_cons) - return; + BUG_ON(done >= TX_RING_SIZE); if (unlikely(netif_msg_tx_done(sky2))) printk(KERN_DEBUG "%s: tx done, up to %u\n",