diff options
author | David S. Miller <davem@davemloft.net> | 2011-04-19 03:21:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-19 03:21:33 -0400 |
commit | e1943424e43974f85b82bb31eaf832823bf49ce7 (patch) | |
tree | 00a2dda7454ba186c0be4bfb8d08b7f74c3cd98c /drivers/net/qlcnic | |
parent | 88230fd586b4ccc5ffe6d6c2df8cdc495e89ad83 (diff) | |
parent | 0553c891fabd287726b41076cfd03fe7e5ab596f (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/bnx2x/bnx2x_ethtool.c
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 1 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index b6e0fc33585f..e5d30538f373 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h | |||
@@ -99,6 +99,7 @@ | |||
99 | #define TX_UDPV6_PKT 0x0c | 99 | #define TX_UDPV6_PKT 0x0c |
100 | 100 | ||
101 | /* Tx defines */ | 101 | /* Tx defines */ |
102 | #define QLCNIC_MAX_FRAGS_PER_TX 14 | ||
102 | #define MAX_TSO_HEADER_DESC 2 | 103 | #define MAX_TSO_HEADER_DESC 2 |
103 | #define MGMT_CMD_DESC_RESV 4 | 104 | #define MGMT_CMD_DESC_RESV 4 |
104 | #define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \ | 105 | #define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \ |
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 7f9edb2f1474..e9e9ba6efc5f 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -2138,6 +2138,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2138 | struct cmd_desc_type0 *hwdesc, *first_desc; | 2138 | struct cmd_desc_type0 *hwdesc, *first_desc; |
2139 | struct pci_dev *pdev; | 2139 | struct pci_dev *pdev; |
2140 | struct ethhdr *phdr; | 2140 | struct ethhdr *phdr; |
2141 | int delta = 0; | ||
2141 | int i, k; | 2142 | int i, k; |
2142 | 2143 | ||
2143 | u32 producer; | 2144 | u32 producer; |
@@ -2157,6 +2158,19 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2157 | } | 2158 | } |
2158 | 2159 | ||
2159 | frag_count = skb_shinfo(skb)->nr_frags + 1; | 2160 | frag_count = skb_shinfo(skb)->nr_frags + 1; |
2161 | /* 14 frags supported for normal packet and | ||
2162 | * 32 frags supported for TSO packet | ||
2163 | */ | ||
2164 | if (!skb_is_gso(skb) && frag_count > QLCNIC_MAX_FRAGS_PER_TX) { | ||
2165 | |||
2166 | for (i = 0; i < (frag_count - QLCNIC_MAX_FRAGS_PER_TX); i++) | ||
2167 | delta += skb_shinfo(skb)->frags[i].size; | ||
2168 | |||
2169 | if (!__pskb_pull_tail(skb, delta)) | ||
2170 | goto drop_packet; | ||
2171 | |||
2172 | frag_count = 1 + skb_shinfo(skb)->nr_frags; | ||
2173 | } | ||
2160 | 2174 | ||
2161 | if (unlikely(qlcnic_tx_avail(tx_ring) <= TX_STOP_THRESH)) { | 2175 | if (unlikely(qlcnic_tx_avail(tx_ring) <= TX_STOP_THRESH)) { |
2162 | netif_stop_queue(netdev); | 2176 | netif_stop_queue(netdev); |