From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 15:42:47 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE7CC1065670; Tue, 2 Dec 2008 15:42:47 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C56808FC08; Tue, 2 Dec 2008 15:42:47 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB2FgldS064505; Tue, 2 Dec 2008 15:42:47 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB2FglPS064504; Tue, 2 Dec 2008 15:42:47 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <200812021542.mB2FglPS064504@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 2 Dec 2008 15:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185564 - head/sys/dev/cxgb/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2008 15:42:48 -0000 Author: gnn Date: Tue Dec 2 15:42:47 2008 New Revision: 185564 URL: http://svn.freebsd.org/changeset/base/185564 Log: Bug fix from Chelsio which addresses the issue of the device resetting when it sees only received packets. In some cases where a device only recieves data it mistakenly thinks that its transmitting side is broken and resets the device. Obtained from: Chelsio Inc. MFC after: 3 days Modified: head/sys/dev/cxgb/common/cxgb_xgmac.c Modified: head/sys/dev/cxgb/common/cxgb_xgmac.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_xgmac.c Tue Dec 2 15:08:33 2008 (r185563) +++ head/sys/dev/cxgb/common/cxgb_xgmac.c Tue Dec 2 15:42:47 2008 (r185564) @@ -633,20 +633,15 @@ int t3b2_mac_watchdog_task(struct cmac * adapter_t *adap = mac->adapter; struct mac_stats *s = &mac->stats; unsigned int tx_mcnt = (unsigned int)s->tx_frames; - unsigned int rx_mcnt = (unsigned int)s->rx_frames; - unsigned int rx_xcnt; if (mac->multiport) { tx_mcnt = t3_read_reg(adap, A_XGM_STAT_TX_FRAME_LOW); - rx_mcnt = t3_read_reg(adap, A_XGM_STAT_RX_FRAMES_LOW); } else { tx_mcnt = (unsigned int)s->tx_frames; - rx_mcnt = (unsigned int)s->rx_frames; } status = 0; tx_xcnt = 1; /* By default tx_xcnt is making progress*/ tx_tcnt = mac->tx_tcnt; /* If tx_mcnt is progressing ignore tx_tcnt*/ - rx_xcnt = 1; /* By default rx_xcnt is making progress*/ if (tx_mcnt == mac->tx_mcnt && mac->rx_pause == s->rx_pause) { tx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap, A_XGM_TX_SPI4_SOP_EOP_CNT + @@ -657,11 +652,11 @@ int t3b2_mac_watchdog_task(struct cmac * tx_tcnt = (G_TXDROPCNTCH0RCVD(t3_read_reg(adap, A_TP_PIO_DATA))); } else { - goto rxcheck; + goto out; } } else { mac->toggle_cnt = 0; - goto rxcheck; + goto out; } if ((tx_tcnt != mac->tx_tcnt) && (mac->tx_xcnt == 0)) { @@ -674,22 +669,6 @@ int t3b2_mac_watchdog_task(struct cmac * } } else { mac->toggle_cnt = 0; - goto rxcheck; - } - -rxcheck: - if (rx_mcnt != mac->rx_mcnt) { - rx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap, - A_XGM_RX_SPI4_SOP_EOP_CNT + - mac->offset))) + - (s->rx_fifo_ovfl - mac->rx_ocnt); - mac->rx_ocnt = s->rx_fifo_ovfl; - } else - goto out; - - if (mac->rx_mcnt != s->rx_frames && rx_xcnt == 0 && mac->rx_xcnt == 0) { - if (!mac->multiport) - status = 2; goto out; } @@ -697,8 +676,6 @@ out: mac->tx_tcnt = tx_tcnt; mac->tx_xcnt = tx_xcnt; mac->tx_mcnt = s->tx_frames; - mac->rx_xcnt = rx_xcnt; - mac->rx_mcnt = s->rx_frames; mac->rx_pause = s->rx_pause; if (status == 1) { t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset, 0);