From owner-svn-src-head@freebsd.org Wed Aug 30 23:41:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67605E0CC85; Wed, 30 Aug 2017 23:41:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3CF0184C3C; Wed, 30 Aug 2017 23:41:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7UNf4xN094878; Wed, 30 Aug 2017 23:41:04 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7UNf4vq094875; Wed, 30 Aug 2017 23:41:04 GMT (envelope-from np@FreeBSD.org) Message-Id: <201708302341.v7UNf4vq094875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 30 Aug 2017 23:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323041 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 323041 X-SVN-Commit-Repository: base 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.23 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: Wed, 30 Aug 2017 23:41:05 -0000 Author: np Date: Wed Aug 30 23:41:04 2017 New Revision: 323041 URL: https://svnweb.freebsd.org/changeset/base/323041 Log: cxgbe(4): Add two new debug flags -- one to allow manual firmware install after full initialization, and another to disable the TCB cache (T6+). The latter works as a tunable only. Note that debug_flags are for debugging only and should not be set normally. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Wed Aug 30 22:58:11 2017 (r323040) +++ head/sys/dev/cxgbe/adapter.h Wed Aug 30 23:41:04 2017 (r323041) @@ -172,7 +172,9 @@ enum { INTR_ALL = (INTR_RXQ | INTR_OFLD_RXQ), /* adapter debug_flags */ - DF_DUMP_MBOX = (1 << 0), + DF_DUMP_MBOX = (1 << 0), /* Log all mbox cmd/rpl. */ + DF_LOAD_FW_ANYTIME = (1 << 1), /* Allow LOAD_FW after init */ + DF_DISABLE_TCB_CACHE = (1 << 2), /* Disable TCB cache (T6+) */ }; #define IS_DOOMED(vi) ((vi)->flags & DOOMED) Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Aug 30 22:58:11 2017 (r323040) +++ head/sys/dev/cxgbe/t4_main.c Wed Aug 30 23:41:04 2017 (r323041) @@ -9049,7 +9049,14 @@ load_fw(struct adapter *sc, struct t4_data *fw) if (rc) return (rc); - if (sc->flags & FULL_INIT_DONE) { + /* + * The firmware, with the sole exception of the memory parity error + * handler, runs from memory and not flash. It is almost always safe to + * install a new firmware on a running system. Just set bit 1 in + * hw.cxgbe.dflags or dev...dflags first. + */ + if (sc->flags & FULL_INIT_DONE && + (sc->debug_flags & DF_LOAD_FW_ANYTIME) == 0) { rc = EBUSY; goto done; } Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Wed Aug 30 22:58:11 2017 (r323040) +++ head/sys/dev/cxgbe/t4_sge.c Wed Aug 30 23:41:04 2017 (r323041) @@ -615,6 +615,16 @@ t4_tweak_chip_settings(struct adapter *sc) else v = V_TSCALE(tscale - 2); t4_set_reg_field(sc, A_SGE_ITP_CONTROL, m, v); + + if (sc->debug_flags & DF_DISABLE_TCB_CACHE) { + m = V_RDTHRESHOLD(M_RDTHRESHOLD) | F_WRTHRTHRESHEN | + V_WRTHRTHRESH(M_WRTHRTHRESH); + t4_tp_pio_read(sc, &v, 1, A_TP_CMM_CONFIG, 1); + v &= ~m; + v |= V_RDTHRESHOLD(1) | F_WRTHRTHRESHEN | + V_WRTHRTHRESH(16); + t4_tp_pio_write(sc, &v, 1, A_TP_CMM_CONFIG, 1); + } } /* 4K, 16K, 64K, 256K DDP "page sizes" for TDDP */