aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic.h
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2009-06-17 13:27:25 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-18 03:46:14 -0400
commitcb2107be43d2fc5eadec58b92b54bf32c00bfff3 (patch)
treedd04fda143a4a7d71b32b79b508a0566450c22c6 /drivers/net/netxen/netxen_nic.h
parentd173346040af497af22818dfc48cff369e67cf50 (diff)
netxen: fix tx ring accounting
This forces every update of tx ring producer to check for availability of space for next full TSO command. Earlier firmware control commands didn't care to pause tx queue. Stop the tx queue if there's not enough space to transmit one full LSO command left on the tx ring after current transmit. This avoids returning NETDEV_TX_BUSY after checking distance between producer and consumer on every cpu. Restart the tx queue only if we have cleaned up enough tx descriptors. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic.h')
-rw-r--r--drivers/net/netxen/netxen_nic.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index ab11c2b3f0fe..970cedeb5f37 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -169,6 +169,7 @@
169#define MAX_NUM_CARDS 4 169#define MAX_NUM_CARDS 4
170 170
171#define MAX_BUFFERS_PER_CMD 32 171#define MAX_BUFFERS_PER_CMD 32
172#define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + 4)
172 173
173/* 174/*
174 * Following are the states of the Phantom. Phantom will set them and 175 * Following are the states of the Phantom. Phantom will set them and
@@ -1436,7 +1437,7 @@ int netxen_nic_set_mac(struct net_device *netdev, void *p);
1436struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev); 1437struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev);
1437 1438
1438void netxen_nic_update_cmd_producer(struct netxen_adapter *adapter, 1439void netxen_nic_update_cmd_producer(struct netxen_adapter *adapter,
1439 struct nx_host_tx_ring *tx_ring, uint32_t crb_producer); 1440 struct nx_host_tx_ring *tx_ring);
1440 1441
1441/* 1442/*
1442 * NetXen Board information 1443 * NetXen Board information
@@ -1538,6 +1539,14 @@ dma_watchdog_wakeup(struct netxen_adapter *adapter)
1538} 1539}
1539 1540
1540 1541
1542static inline u32 netxen_tx_avail(struct nx_host_tx_ring *tx_ring)
1543{
1544 smp_mb();
1545 return find_diff_among(tx_ring->producer,
1546 tx_ring->sw_consumer, tx_ring->num_desc);
1547
1548}
1549
1541int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 *mac); 1550int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 *mac);
1542int netxen_p3_get_mac_addr(struct netxen_adapter *adapter, __le64 *mac); 1551int netxen_p3_get_mac_addr(struct netxen_adapter *adapter, __le64 *mac);
1543extern void netxen_change_ringparam(struct netxen_adapter *adapter); 1552extern void netxen_change_ringparam(struct netxen_adapter *adapter);