diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2006-05-23 13:29:53 -0400 |
---|---|---|
committer | Auke Kok <juke-jan.h.kok@intel.com> | 2006-05-23 13:29:53 -0400 |
commit | f017f14b3f18b38f2388e7d6e83a7f6997ee9dd6 (patch) | |
tree | f4afafd176b7b8a1635e58dfa2f24f859dce9ed4 /drivers/net/ixgb | |
parent | 953784d66d8f621a8684d007e526ca26b12d54a1 (diff) |
ixgb: add NETIF_F_LLTX analogous to e1000
add NETIF_F_LLTX code like e1000 has
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
Diffstat (limited to 'drivers/net/ixgb')
-rw-r--r-- | drivers/net/ixgb/ixgb_main.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index 13181c4f1d20..466cbe208ef2 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -449,6 +449,9 @@ ixgb_probe(struct pci_dev *pdev, | |||
449 | #ifdef NETIF_F_TSO | 449 | #ifdef NETIF_F_TSO |
450 | netdev->features |= NETIF_F_TSO; | 450 | netdev->features |= NETIF_F_TSO; |
451 | #endif | 451 | #endif |
452 | #ifdef NETIF_F_LLTX | ||
453 | netdev->features |= NETIF_F_LLTX; | ||
454 | #endif | ||
452 | 455 | ||
453 | if(pci_using_dac) | 456 | if(pci_using_dac) |
454 | netdev->features |= NETIF_F_HIGHDMA; | 457 | netdev->features |= NETIF_F_HIGHDMA; |
@@ -1408,13 +1411,26 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1408 | return 0; | 1411 | return 0; |
1409 | } | 1412 | } |
1410 | 1413 | ||
1414 | #ifdef NETIF_F_LLTX | ||
1415 | local_irq_save(flags); | ||
1416 | if (!spin_trylock(&adapter->tx_lock)) { | ||
1417 | /* Collision - tell upper layer to requeue */ | ||
1418 | local_irq_restore(flags); | ||
1419 | return NETDEV_TX_LOCKED; | ||
1420 | } | ||
1421 | #else | ||
1411 | spin_lock_irqsave(&adapter->tx_lock, flags); | 1422 | spin_lock_irqsave(&adapter->tx_lock, flags); |
1423 | #endif | ||
1424 | |||
1412 | if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) { | 1425 | if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) { |
1413 | netif_stop_queue(netdev); | 1426 | netif_stop_queue(netdev); |
1414 | spin_unlock_irqrestore(&adapter->tx_lock, flags); | 1427 | spin_unlock_irqrestore(&adapter->tx_lock, flags); |
1415 | return 1; | 1428 | return NETDEV_TX_BUSY; |
1416 | } | 1429 | } |
1430 | |||
1431 | #ifndef NETIF_F_LLTX | ||
1417 | spin_unlock_irqrestore(&adapter->tx_lock, flags); | 1432 | spin_unlock_irqrestore(&adapter->tx_lock, flags); |
1433 | #endif | ||
1418 | 1434 | ||
1419 | if(adapter->vlgrp && vlan_tx_tag_present(skb)) { | 1435 | if(adapter->vlgrp && vlan_tx_tag_present(skb)) { |
1420 | tx_flags |= IXGB_TX_FLAGS_VLAN; | 1436 | tx_flags |= IXGB_TX_FLAGS_VLAN; |
@@ -1426,6 +1442,9 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1426 | tso = ixgb_tso(adapter, skb); | 1442 | tso = ixgb_tso(adapter, skb); |
1427 | if (tso < 0) { | 1443 | if (tso < 0) { |
1428 | dev_kfree_skb_any(skb); | 1444 | dev_kfree_skb_any(skb); |
1445 | #ifdef NETIF_F_LLTX | ||
1446 | spin_unlock_irqrestore(&adapter->tx_lock, flags); | ||
1447 | #endif | ||
1429 | return NETDEV_TX_OK; | 1448 | return NETDEV_TX_OK; |
1430 | } | 1449 | } |
1431 | 1450 | ||
@@ -1439,7 +1458,15 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1439 | 1458 | ||
1440 | netdev->trans_start = jiffies; | 1459 | netdev->trans_start = jiffies; |
1441 | 1460 | ||
1442 | return 0; | 1461 | #ifdef NETIF_F_LLTX |
1462 | /* Make sure there is space in the ring for the next send. */ | ||
1463 | if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) | ||
1464 | netif_stop_queue(netdev); | ||
1465 | |||
1466 | spin_unlock_irqrestore(&adapter->tx_lock, flags); | ||
1467 | |||
1468 | #endif | ||
1469 | return NETDEV_TX_OK; | ||
1443 | } | 1470 | } |
1444 | 1471 | ||
1445 | /** | 1472 | /** |