Skip to content

Commit b4687ff

Browse files
Divy Le RayDavid S. Miller
authored andcommitted
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 <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
1 parent 3eea333 commit b4687ff

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/net/cxgb3/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ struct cmac {
513513
u64 rx_mcnt;
514514
unsigned int toggle_cnt;
515515
unsigned int txen;
516+
u64 rx_pause;
516517
struct mac_stats stats;
517518
};
518519

drivers/net/cxgb3/xgmac.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ int t3_mac_enable(struct cmac *mac, int which)
452452
A_XGM_TX_SPI4_SOP_EOP_CNT +
453453
oft)));
454454
mac->rx_mcnt = s->rx_frames;
455+
mac->rx_pause = s->rx_pause;
455456
mac->rx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
456457
A_XGM_RX_SPI4_SOP_EOP_CNT +
457458
oft)));
@@ -504,7 +505,7 @@ int t3b2_mac_watchdog_task(struct cmac *mac)
504505
tx_xcnt = 1; /* By default tx_xcnt is making progress */
505506
tx_tcnt = mac->tx_tcnt; /* If tx_mcnt is progressing ignore tx_tcnt */
506507
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) {
508509
tx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
509510
A_XGM_TX_SPI4_SOP_EOP_CNT +
510511
mac->offset)));
@@ -560,6 +561,7 @@ int t3b2_mac_watchdog_task(struct cmac *mac)
560561
mac->tx_mcnt = s->tx_frames;
561562
mac->rx_xcnt = rx_xcnt;
562563
mac->rx_mcnt = s->rx_frames;
564+
mac->rx_pause = s->rx_pause;
563565
if (status == 1) {
564566
t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset, 0);
565567
t3_read_reg(adap, A_XGM_TX_CTRL + mac->offset); /* flush */

0 commit comments

Comments
 (0)