提交 e8b5fc51 编写于 作者: V Vladislav Zolotarov 提交者: David S. Miller

bnx2x: tx_has_work should not wait for FW

The current tx_has_work waited until all packets sent by the driver
are marked as completed by the FW. This is too greedy and it causes
the bnx2x_poll to spin in vain. The driver should only check that all
packets FW already completed are freed - only in unload flow the
driver should make sure that transmit queue is empty
Signed-off-by: NVladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: NEilon Greenstein <eilong@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 32ec8033
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
#include "bnx2x.h" #include "bnx2x.h"
#include "bnx2x_init.h" #include "bnx2x_init.h"
#define DRV_MODULE_VERSION "1.45.25" #define DRV_MODULE_VERSION "1.45.26"
#define DRV_MODULE_RELDATE "2009/01/22" #define DRV_MODULE_RELDATE "2009/01/26"
#define BNX2X_BC_VER 0x040200 #define BNX2X_BC_VER 0x040200
/* Time in jiffies before concluding the transmitter is hung */ /* Time in jiffies before concluding the transmitter is hung */
...@@ -740,8 +740,15 @@ static inline int bnx2x_has_tx_work(struct bnx2x_fastpath *fp) ...@@ -740,8 +740,15 @@ static inline int bnx2x_has_tx_work(struct bnx2x_fastpath *fp)
/* Tell compiler that status block fields can change */ /* Tell compiler that status block fields can change */
barrier(); barrier();
tx_cons_sb = le16_to_cpu(*fp->tx_cons_sb); tx_cons_sb = le16_to_cpu(*fp->tx_cons_sb);
return ((fp->tx_pkt_prod != tx_cons_sb) || return (fp->tx_pkt_cons != tx_cons_sb);
(fp->tx_pkt_prod != fp->tx_pkt_cons)); }
static inline int bnx2x_has_tx_work_unload(struct bnx2x_fastpath *fp)
{
/* Tell compiler that consumer and producer can change */
barrier();
return (fp->tx_pkt_prod != fp->tx_pkt_cons);
} }
/* free skb in the packet ring at pos idx /* free skb in the packet ring at pos idx
...@@ -6729,7 +6736,7 @@ static int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode) ...@@ -6729,7 +6736,7 @@ static int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode)
cnt = 1000; cnt = 1000;
smp_rmb(); smp_rmb();
while (bnx2x_has_tx_work(fp)) { while (bnx2x_has_tx_work_unload(fp)) {
bnx2x_tx_int(fp, 1000); bnx2x_tx_int(fp, 1000);
if (!cnt) { if (!cnt) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册