From owner-svn-src-stable@FreeBSD.ORG Thu Oct 1 15:51:29 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9660F106568B; Thu, 1 Oct 2009 15:51:29 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AB198FC1F; Thu, 1 Oct 2009 15:51:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91FpTvs056480; Thu, 1 Oct 2009 15:51:29 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91FpTnj056477; Thu, 1 Oct 2009 15:51:29 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200910011551.n91FpTnj056477@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 1 Oct 2009 15:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197676 - in stable/6/sys: . conf contrib/pf dev/cxgb dev/mxge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2009 15:51:29 -0000 Author: gallatin Date: Thu Oct 1 15:51:29 2009 New Revision: 197676 URL: http://svn.freebsd.org/changeset/base/197676 Log: MFC: more fixes for mxge watchdog reset handling (194761 197645) 194761: Fix bug where device would loose promisc setting when reset. 197645: Restore the PCI Express control register after reset Modified: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/dev/mxge/if_mxge.c stable/6/sys/dev/mxge/if_mxge_var.h Modified: stable/6/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/6/sys/dev/mxge/if_mxge.c Thu Oct 1 15:40:08 2009 (r197675) +++ stable/6/sys/dev/mxge/if_mxge.c Thu Oct 1 15:51:29 2009 (r197676) @@ -1296,7 +1296,7 @@ mxge_reset(mxge_softc_t *sc, int interru } sc->rdma_tags_available = 15; status = mxge_update_mac_address(sc); - mxge_change_promisc(sc, 0); + mxge_change_promisc(sc, sc->ifp->if_flags & IFF_PROMISC); mxge_change_pause(sc, sc->pause); mxge_set_multicast_list(sc); return status; @@ -3420,10 +3420,16 @@ mxge_setup_cfg_space(mxge_softc_t *sc) if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { lnk = pci_read_config(dev, reg + 0x12, 2); sc->link_width = (lnk >> 4) & 0x3f; - - pectl = pci_read_config(dev, reg + 0x8, 2); - pectl = (pectl & ~0x7000) | (5 << 12); - pci_write_config(dev, reg + 0x8, pectl, 2); + + if (sc->pectl == 0) { + pectl = pci_read_config(dev, reg + 0x8, 2); + pectl = (pectl & ~0x7000) | (5 << 12); + pci_write_config(dev, reg + 0x8, pectl, 2); + sc->pectl = pectl; + } else { + /* restore saved pectl after watchdog reset */ + pci_write_config(dev, reg + 0x8, sc->pectl, 2); + } } /* Enable DMA and Memory space access */ @@ -3534,6 +3540,9 @@ mxge_watchdog_reset(mxge_softc_t *sc) /* release all TX locks */ for (s = 0; s < num_tx_slices; s++) { ss = &sc->ss[s]; +#ifdef IFNET_BUF_RING + mxge_start_locked(ss); +#endif mtx_unlock(&ss->tx.mtx); } } @@ -3796,7 +3805,7 @@ mxge_fetch_tunables(mxge_softc_t *sc) mxge_ticks = hz / 2; sc->pause = mxge_flow_control; if (mxge_rss_hash_type < MXGEFW_RSS_HASH_TYPE_IPV4 - || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_SRC_PORT) { + || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_MAX) { mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; } } Modified: stable/6/sys/dev/mxge/if_mxge_var.h ============================================================================== --- stable/6/sys/dev/mxge/if_mxge_var.h Thu Oct 1 15:40:08 2009 (r197675) +++ stable/6/sys/dev/mxge/if_mxge_var.h Thu Oct 1 15:51:29 2009 (r197676) @@ -253,6 +253,7 @@ struct mxge_softc { struct sysctl_ctx_list slice_sysctl_ctx; char *mac_addr_string; uint8_t mac_addr[6]; /* eeprom mac address */ + uint16_t pectl; /* save PCIe CTL state */ char product_code_string[64]; char serial_number_string[64]; char cmd_mtx_name[16];