diff options
author | Rajesh K Borundia <rajesh.borundia@qlogic.com> | 2010-06-17 02:56:41 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-17 08:57:56 -0700 |
commit | ef71ff833acfd3795c3af1bb800ac186561508ef (patch) | |
tree | fa285765677574d4aafb42c9fbbc32443a8e4597 /drivers/net/qlcnic/qlcnic.h | |
parent | 8f891387aa73b85d2ea8d953e04dac224f687e52 (diff) | |
download | lwn-ef71ff833acfd3795c3af1bb800ac186561508ef.tar.gz lwn-ef71ff833acfd3795c3af1bb800ac186561508ef.zip |
qlcnic: fix race in tx stop queue
There is a race between netif_stop_queue and netif_stopped_queue
check. So check once again if buffers are available to avoid race.
With above logic we can also get rid of tx lock in process_cmd_ring.
Signed-off-by: Rajesh K Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic.h')
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index 9970cff598d1..99ccdd8ac419 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h @@ -113,8 +113,10 @@ #define TX_UDPV6_PKT 0x0c /* Tx defines */ -#define MAX_BUFFERS_PER_CMD 32 -#define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + 4) +#define MAX_TSO_HEADER_DESC 2 +#define MGMT_CMD_DESC_RESV 4 +#define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \ + + MGMT_CMD_DESC_RESV) #define QLCNIC_MAX_TX_TIMEOUTS 2 /* @@ -369,7 +371,7 @@ struct qlcnic_recv_crb { */ struct qlcnic_cmd_buffer { struct sk_buff *skb; - struct qlcnic_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1]; + struct qlcnic_skb_frag frag_array[MAX_SKB_FRAGS + 1]; u32 frag_count; }; |