Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27320
b: refs/heads/master
c: f017f14
h: refs/heads/master
v: v3
  • Loading branch information
Auke Kok authored and Auke Kok committed May 23, 2006
1 parent 2febdd0 commit 09e1b2d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 953784d66d8f621a8684d007e526ca26b12d54a1
refs/heads/master: f017f14b3f18b38f2388e7d6e83a7f6997ee9dd6
31 changes: 29 additions & 2 deletions trunk/drivers/net/ixgb/ixgb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,9 @@ ixgb_probe(struct pci_dev *pdev,
#ifdef NETIF_F_TSO
netdev->features |= NETIF_F_TSO;
#endif
#ifdef NETIF_F_LLTX
netdev->features |= NETIF_F_LLTX;
#endif

if(pci_using_dac)
netdev->features |= NETIF_F_HIGHDMA;
Expand Down Expand Up @@ -1408,13 +1411,26 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
return 0;
}

#ifdef NETIF_F_LLTX
local_irq_save(flags);
if (!spin_trylock(&adapter->tx_lock)) {
/* Collision - tell upper layer to requeue */
local_irq_restore(flags);
return NETDEV_TX_LOCKED;
}
#else
spin_lock_irqsave(&adapter->tx_lock, flags);
#endif

if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) {
netif_stop_queue(netdev);
spin_unlock_irqrestore(&adapter->tx_lock, flags);
return 1;
return NETDEV_TX_BUSY;
}

#ifndef NETIF_F_LLTX
spin_unlock_irqrestore(&adapter->tx_lock, flags);
#endif

if(adapter->vlgrp && vlan_tx_tag_present(skb)) {
tx_flags |= IXGB_TX_FLAGS_VLAN;
Expand All @@ -1426,6 +1442,9 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
tso = ixgb_tso(adapter, skb);
if (tso < 0) {
dev_kfree_skb_any(skb);
#ifdef NETIF_F_LLTX
spin_unlock_irqrestore(&adapter->tx_lock, flags);
#endif
return NETDEV_TX_OK;
}

Expand All @@ -1439,7 +1458,15 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)

netdev->trans_start = jiffies;

return 0;
#ifdef NETIF_F_LLTX
/* Make sure there is space in the ring for the next send. */
if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED))
netif_stop_queue(netdev);

spin_unlock_irqrestore(&adapter->tx_lock, flags);

#endif
return NETDEV_TX_OK;
}

/**
Expand Down

0 comments on commit 09e1b2d

Please sign in to comment.