From owner-svn-src-head@FreeBSD.ORG Fri Jul 18 20:04:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F6FDE77; Fri, 18 Jul 2014 20:04:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C69C2978; Fri, 18 Jul 2014 20:04:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IK4C7r059565; Fri, 18 Jul 2014 20:04:12 GMT (envelope-from davidcs@svn.freebsd.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IK4CS0059556; Fri, 18 Jul 2014 20:04:12 GMT (envelope-from davidcs@svn.freebsd.org) Message-Id: <201407182004.s6IK4CS0059556@svn.freebsd.org> From: David C Somayajulu Date: Fri, 18 Jul 2014 20:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268854 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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: Fri, 18 Jul 2014 20:04:13 -0000 Author: davidcs Date: Fri Jul 18 20:04:11 2014 New Revision: 268854 URL: http://svnweb.freebsd.org/changeset/base/268854 Log: Initiate error recovery stats fail to update after 3 retries. Change bxe_panic() ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() to panic only if ECORE_STOP_ON_ERROR is defined. MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/ecore_reg.h head/sys/dev/bxe/ecore_sp.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Fri Jul 18 18:11:24 2014 (r268853) +++ head/sys/dev/bxe/bxe.c Fri Jul 18 20:04:11 2014 (r268854) @@ -11471,6 +11471,10 @@ bxe_process_kill(struct bxe_softc *sc, bxe_process_kill_chip_reset(sc, global); mb(); + /* clear errors in PGB */ + if (!CHIP_IS_E1(sc)) + REG_WR(sc, PGLUE_B_REG_LATCHED_ERRORS_CLR, 0x7f); + /* Recover after reset: */ /* MCP */ if (global && bxe_reset_mcp_comp(sc, val)) { Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Fri Jul 18 18:11:24 2014 (r268853) +++ head/sys/dev/bxe/bxe.h Fri Jul 18 20:04:11 2014 (r268854) @@ -2301,11 +2301,20 @@ void ecore_storm_memset_struct(struct bx } \ } while(0) +#ifdef ECORE_STOP_ON_ERROR + #define bxe_panic(sc, msg) \ do { \ panic msg; \ } while (0) +#else + +#define bxe_panic(sc, msg) \ + device_printf((sc)->dev, "%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + +#endif + #define CATC_TRIGGER(sc, data) REG_WR((sc), 0x2000, (data)); #define CATC_TRIGGER_START(sc) CATC_TRIGGER((sc), 0xcafecafe) Modified: head/sys/dev/bxe/bxe_stats.c ============================================================================== --- head/sys/dev/bxe/bxe_stats.c Fri Jul 18 18:11:24 2014 (r268853) +++ head/sys/dev/bxe/bxe_stats.c Fri Jul 18 20:04:11 2014 (r268854) @@ -1302,7 +1302,10 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { - bxe_panic(sc, ("storm stats not updated for 3 times\n")); + if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { + atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); + taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); + } } return; } Modified: head/sys/dev/bxe/ecore_reg.h ============================================================================== --- head/sys/dev/bxe/ecore_reg.h Fri Jul 18 18:11:24 2014 (r268853) +++ head/sys/dev/bxe/ecore_reg.h Fri Jul 18 20:04:11 2014 (r268854) @@ -1039,6 +1039,8 @@ __FBSDID("$FreeBSD$"); 0x942cUL #define PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ \ 0x9430UL +#define PGLUE_B_REG_LATCHED_ERRORS_CLR \ + 0x943CUL #define PGLUE_B_REG_PGLUE_B_INT_STS \ 0x9298UL #define PGLUE_B_REG_PGLUE_B_INT_STS_CLR \ Modified: head/sys/dev/bxe/ecore_sp.h ============================================================================== --- head/sys/dev/bxe/ecore_sp.h Fri Jul 18 18:11:24 2014 (r268853) +++ head/sys/dev/bxe/ecore_sp.h Fri Jul 18 20:04:11 2014 (r268854) @@ -223,6 +223,8 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m #define ecore_sp_post(_sc, _a, _b, _c, _d) \ bxe_sp_post(_sc, _a, _b, U64_HI(_c), U64_LO(_c), _d) +#ifdef ECORE_STOP_ON_ERROR + #define ECORE_DBG_BREAK_IF(exp) \ do { \ if (__predict_false(exp)) { \ @@ -242,6 +244,20 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m } \ } while (0) +#else + +#define ECORE_DBG_BREAK_IF(exp) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + +#define ECORE_BUG(exp) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + +#define ECORE_BUG_ON(exp) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + + +#endif /* #ifdef ECORE_STOP_ON_ERROR */ + #define ECORE_ERR(str, ...) \ BLOGE(sc, "ECORE: " str, ##__VA_ARGS__)