提交 b4687ff7 编写于 作者: D Divy Le Ray 提交者: David S. Miller

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: NDivy Le Ray <divy@chelsio.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 3eea3337
...@@ -513,6 +513,7 @@ struct cmac { ...@@ -513,6 +513,7 @@ struct cmac {
u64 rx_mcnt; u64 rx_mcnt;
unsigned int toggle_cnt; unsigned int toggle_cnt;
unsigned int txen; unsigned int txen;
u64 rx_pause;
struct mac_stats stats; struct mac_stats stats;
}; };
......
...@@ -452,6 +452,7 @@ int t3_mac_enable(struct cmac *mac, int which) ...@@ -452,6 +452,7 @@ int t3_mac_enable(struct cmac *mac, int which)
A_XGM_TX_SPI4_SOP_EOP_CNT + A_XGM_TX_SPI4_SOP_EOP_CNT +
oft))); oft)));
mac->rx_mcnt = s->rx_frames; mac->rx_mcnt = s->rx_frames;
mac->rx_pause = s->rx_pause;
mac->rx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap, mac->rx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
A_XGM_RX_SPI4_SOP_EOP_CNT + A_XGM_RX_SPI4_SOP_EOP_CNT +
oft))); oft)));
...@@ -504,7 +505,7 @@ int t3b2_mac_watchdog_task(struct cmac *mac) ...@@ -504,7 +505,7 @@ int t3b2_mac_watchdog_task(struct cmac *mac)
tx_xcnt = 1; /* By default tx_xcnt is making progress */ tx_xcnt = 1; /* By default tx_xcnt is making progress */
tx_tcnt = mac->tx_tcnt; /* If tx_mcnt is progressing ignore tx_tcnt */ tx_tcnt = mac->tx_tcnt; /* If tx_mcnt is progressing ignore tx_tcnt */
rx_xcnt = 1; /* By default rx_xcnt is making progress */ rx_xcnt = 1; /* By default rx_xcnt is making progress */
if (tx_mcnt == mac->tx_mcnt) { if (tx_mcnt == mac->tx_mcnt && mac->rx_pause == s->rx_pause) {
tx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap, tx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
A_XGM_TX_SPI4_SOP_EOP_CNT + A_XGM_TX_SPI4_SOP_EOP_CNT +
mac->offset))); mac->offset)));
...@@ -560,6 +561,7 @@ int t3b2_mac_watchdog_task(struct cmac *mac) ...@@ -560,6 +561,7 @@ int t3b2_mac_watchdog_task(struct cmac *mac)
mac->tx_mcnt = s->tx_frames; mac->tx_mcnt = s->tx_frames;
mac->rx_xcnt = rx_xcnt; mac->rx_xcnt = rx_xcnt;
mac->rx_mcnt = s->rx_frames; mac->rx_mcnt = s->rx_frames;
mac->rx_pause = s->rx_pause;
if (status == 1) { if (status == 1) {
t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset, 0); t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset, 0);
t3_read_reg(adap, A_XGM_TX_CTRL + mac->offset); /* flush */ t3_read_reg(adap, A_XGM_TX_CTRL + mac->offset); /* flush */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册