aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2007-09-05 18:58:20 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:04 -0400
commitb4687ff753c2c5c330989efed7cdf1a6bc6b512e (patch)
tree0fdce28a3da7a32c114edacd6cf3be85f823f054 /drivers/net/cxgb3
parent3eea3337a08a2ed2addac1551a9d446f2c16acd5 (diff)
cxgb3 - remove false positive in xgmac workaround
Qualify toggling of xgmac tx enable with not getting pause frames, we might not make forward progress because the peer is sending lots of pause frames. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/cxgb3')
-rw-r--r--drivers/net/cxgb3/common.h1
-rw-r--r--drivers/net/cxgb3/xgmac.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h
index ada5e4b89cd8..7e9e43d1074e 100644
--- a/drivers/net/cxgb3/common.h
+++ b/drivers/net/cxgb3/common.h
@@ -513,6 +513,7 @@ struct cmac {
513 u64 rx_mcnt; 513 u64 rx_mcnt;
514 unsigned int toggle_cnt; 514 unsigned int toggle_cnt;
515 unsigned int txen; 515 unsigned int txen;
516 u64 rx_pause;
516 struct mac_stats stats; 517 struct mac_stats stats;
517}; 518};
518 519
diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c
index 1d1c3919ab66..ff9e9dcbd87d 100644
--- a/drivers/net/cxgb3/xgmac.c
+++ b/drivers/net/cxgb3/xgmac.c
@@ -452,6 +452,7 @@ int t3_mac_enable(struct cmac *mac, int which)
452 A_XGM_TX_SPI4_SOP_EOP_CNT + 452 A_XGM_TX_SPI4_SOP_EOP_CNT +
453 oft))); 453 oft)));
454 mac->rx_mcnt = s->rx_frames; 454 mac->rx_mcnt = s->rx_frames;
455 mac->rx_pause = s->rx_pause;
455 mac->rx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap, 456 mac->rx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
456 A_XGM_RX_SPI4_SOP_EOP_CNT + 457 A_XGM_RX_SPI4_SOP_EOP_CNT +
457 oft))); 458 oft)));
@@ -504,7 +505,7 @@ int t3b2_mac_watchdog_task(struct cmac *mac)
504 tx_xcnt = 1; /* By default tx_xcnt is making progress */ 505 tx_xcnt = 1; /* By default tx_xcnt is making progress */
505 tx_tcnt = mac->tx_tcnt; /* If tx_mcnt is progressing ignore tx_tcnt */ 506 tx_tcnt = mac->tx_tcnt; /* If tx_mcnt is progressing ignore tx_tcnt */
506 rx_xcnt = 1; /* By default rx_xcnt is making progress */ 507 rx_xcnt = 1; /* By default rx_xcnt is making progress */
507 if (tx_mcnt == mac->tx_mcnt) { 508 if (tx_mcnt == mac->tx_mcnt && mac->rx_pause == s->rx_pause) {
508 tx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap, 509 tx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
509 A_XGM_TX_SPI4_SOP_EOP_CNT + 510 A_XGM_TX_SPI4_SOP_EOP_CNT +
510 mac->offset))); 511 mac->offset)));
@@ -560,6 +561,7 @@ out:
560 mac->tx_mcnt = s->tx_frames; 561 mac->tx_mcnt = s->tx_frames;
561 mac->rx_xcnt = rx_xcnt; 562 mac->rx_xcnt = rx_xcnt;
562 mac->rx_mcnt = s->rx_frames; 563 mac->rx_mcnt = s->rx_frames;
564 mac->rx_pause = s->rx_pause;
563 if (status == 1) { 565 if (status == 1) {
564 t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset, 0); 566 t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset, 0);
565 t3_read_reg(adap, A_XGM_TX_CTRL + mac->offset); /* flush */ 567 t3_read_reg(adap, A_XGM_TX_CTRL + mac->offset); /* flush */