aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_init.c
diff options
context:
space:
mode:
authordhananjay@netxen.com <dhananjay@netxen.com>2007-12-26 13:23:58 -0500
committerJeff Garzik <jeff@garzik.org>2008-01-12 17:35:38 -0500
commit53a01e00f8c78bc5875e09aca7749ea54bb09798 (patch)
tree00e5edaaf2d51d406bea63afd26dc41748c193f2 /drivers/net/netxen/netxen_nic_init.c
parent72b0a7a8a40a50cf2eab42fd6a56e04b05090434 (diff)
netxen: optimize tx handling
netxen driver allows limited number of threads simultaneously posting skb's in tx ring. If transmit slot is unavailable, driver calls schedule() or loops in xmit_frame(). This patch returns TX_BUSY and lets the stack reschedule the packet if transmit slot is unavailable. Also removes unnecessary check for tx timeout in the driver itself, the network stack does that anyway. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_init.c')
-rw-r--r--drivers/net/netxen/netxen_nic_init.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 37589265297e..5f85ad686c98 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -1248,7 +1248,6 @@ int netxen_process_cmd_ring(unsigned long data)
1248 struct pci_dev *pdev; 1248 struct pci_dev *pdev;
1249 struct netxen_skb_frag *frag; 1249 struct netxen_skb_frag *frag;
1250 u32 i; 1250 u32 i;
1251 struct sk_buff *skb = NULL;
1252 int done; 1251 int done;
1253 1252
1254 spin_lock(&adapter->tx_lock); 1253 spin_lock(&adapter->tx_lock);
@@ -1278,9 +1277,8 @@ int netxen_process_cmd_ring(unsigned long data)
1278 while ((last_consumer != consumer) && (count1 < MAX_STATUS_HANDLE)) { 1277 while ((last_consumer != consumer) && (count1 < MAX_STATUS_HANDLE)) {
1279 buffer = &adapter->cmd_buf_arr[last_consumer]; 1278 buffer = &adapter->cmd_buf_arr[last_consumer];
1280 pdev = adapter->pdev; 1279 pdev = adapter->pdev;
1281 frag = &buffer->frag_array[0]; 1280 if (buffer->skb) {
1282 skb = buffer->skb; 1281 frag = &buffer->frag_array[0];
1283 if (skb && (cmpxchg(&buffer->skb, skb, 0) == skb)) {
1284 pci_unmap_single(pdev, frag->dma, frag->length, 1282 pci_unmap_single(pdev, frag->dma, frag->length,
1285 PCI_DMA_TODEVICE); 1283 PCI_DMA_TODEVICE);
1286 frag->dma = 0ULL; 1284 frag->dma = 0ULL;
@@ -1293,8 +1291,8 @@ int netxen_process_cmd_ring(unsigned long data)
1293 } 1291 }
1294 1292
1295 adapter->stats.skbfreed++; 1293 adapter->stats.skbfreed++;
1296 dev_kfree_skb_any(skb); 1294 dev_kfree_skb_any(buffer->skb);
1297 skb = NULL; 1295 buffer->skb = NULL;
1298 } else if (adapter->proc_cmd_buf_counter == 1) { 1296 } else if (adapter->proc_cmd_buf_counter == 1) {
1299 adapter->stats.txnullskb++; 1297 adapter->stats.txnullskb++;
1300 } 1298 }