]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.drivers/bnx2x-tx_has_work-should-not-wait-for-FW.patch
Revert "Move xen patchset to new version's subdir."
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.drivers / bnx2x-tx_has_work-should-not-wait-for-FW.patch
CommitLineData
00e5a55c
BS
1From e8b5fc514d1c7637cb4b8f77e7d8ac33ef66130c Mon Sep 17 00:00:00 2001
2From: Vladislav Zolotarov <vladz@broadcom.com>
3Date: Mon, 26 Jan 2009 12:36:42 -0800
4Subject: bnx2x: tx_has_work should not wait for FW
5Acked-by: Karsten Keil <kkeil@novell.com>
6Reference: bnc#472500
7
8The current tx_has_work waited until all packets sent by the driver
9are marked as completed by the FW. This is too greedy and it causes
10the bnx2x_poll to spin in vain. The driver should only check that all
11packets FW already completed are freed - only in unload flow the
12driver should make sure that transmit queue is empty
13
14Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
15Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
16Signed-off-by: David S. Miller <davem@davemloft.net>
17---
18 drivers/net/bnx2x_main.c | 17 ++++++++++++-----
19 1 files changed, 12 insertions(+), 5 deletions(-)
20
21Index: linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c
22===================================================================
23--- linux-2.6.27-bnx2x_2.orig/drivers/net/bnx2x_main.c
24+++ linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c
25@@ -57,8 +57,8 @@
26 #include "bnx2x.h"
27 #include "bnx2x_init.h"
28
29-#define DRV_MODULE_VERSION "1.45.25"
30-#define DRV_MODULE_RELDATE "2009/01/22"
31+#define DRV_MODULE_VERSION "1.45.26"
32+#define DRV_MODULE_RELDATE "2009/01/26"
33 #define BNX2X_BC_VER 0x040200
34
35 /* Time in jiffies before concluding the transmitter is hung */
36@@ -740,8 +740,15 @@ static inline int bnx2x_has_tx_work(stru
37 /* Tell compiler that status block fields can change */
38 barrier();
39 tx_cons_sb = le16_to_cpu(*fp->tx_cons_sb);
40- return ((fp->tx_pkt_prod != tx_cons_sb) ||
41- (fp->tx_pkt_prod != fp->tx_pkt_cons));
42+ return (fp->tx_pkt_cons != tx_cons_sb);
43+}
44+
45+static inline int bnx2x_has_tx_work_unload(struct bnx2x_fastpath *fp)
46+{
47+ /* Tell compiler that consumer and producer can change */
48+ barrier();
49+ return (fp->tx_pkt_prod != fp->tx_pkt_cons);
50+
51 }
52
53 /* free skb in the packet ring at pos idx
54@@ -6732,7 +6739,7 @@ static int bnx2x_nic_unload(struct bnx2x
55
56 cnt = 1000;
57 smp_rmb();
58- while (bnx2x_has_tx_work(fp)) {
59+ while (bnx2x_has_tx_work_unload(fp)) {
60
61 bnx2x_tx_int(fp, 1000);
62 if (!cnt) {