Skip to content

Commit

Permalink
[PATCH] skge: get rid of warning on race
Browse files Browse the repository at this point in the history
Get rid of warning in case of race with ring full and lockless
tx on the skge driver. It is possible to be in the transmit
routine with no available slots and already stopped.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Dec 13, 2005
1 parent 0e67050 commit ee1c819
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/net/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -2280,11 +2280,13 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev)
}

if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) {
netif_stop_queue(dev);
spin_unlock_irqrestore(&skge->tx_lock, flags);
if (!netif_stopped(dev)) {
netif_stop_queue(dev);

printk(KERN_WARNING PFX "%s: ring full when queue awake!\n",
dev->name);
printk(KERN_WARNING PFX "%s: ring full when queue awake!\n",
dev->name);
}
spin_unlock_irqrestore(&skge->tx_lock, flags);
return NETDEV_TX_BUSY;
}

Expand Down

0 comments on commit ee1c819

Please sign in to comment.