From owner-svn-src-head@freebsd.org Thu Feb 28 05:45:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EDB41519E66; Thu, 28 Feb 2019 05:45:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0D3277C07; Thu, 28 Feb 2019 05:45:14 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB8BC63A; Thu, 28 Feb 2019 05:45:14 +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 x1S5jELA007183; Thu, 28 Feb 2019 05:45:14 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1S5jEA4007182; Thu, 28 Feb 2019 05:45:14 GMT (envelope-from np@FreeBSD.org) Message-Id: <201902280545.x1S5jEA4007182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 28 Feb 2019 05:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344654 - 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: 344654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E0D3277C07 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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: Thu, 28 Feb 2019 05:45:15 -0000 Author: np Date: Thu Feb 28 05:45:14 2019 New Revision: 344654 URL: https://svnweb.freebsd.org/changeset/base/344654 Log: cxgbe(4): Request high priority filter support explicitly, as required by recent firmwares. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Feb 28 02:29:48 2019 (r344653) +++ head/sys/dev/cxgbe/t4_main.c Thu Feb 28 05:45:14 2019 (r344654) @@ -608,6 +608,7 @@ static int cfg_itype_and_nqueues(struct adapter *, str static int contact_firmware(struct adapter *); static int partition_resources(struct adapter *); static int get_params__pre_init(struct adapter *); +static int set_params__pre_init(struct adapter *); static int get_params__post_init(struct adapter *); static int set_params__post_init(struct adapter *); static void t4_set_desc(struct adapter *); @@ -3955,6 +3956,7 @@ apply_cfg_and_initialize(struct adapter *sc, char *cfg } t4_tweak_chip_settings(sc); + set_params__pre_init(sc); /* get basic stuff going */ rc = -t4_fw_initialize(sc, sc->mbox); @@ -4077,6 +4079,35 @@ get_params__pre_init(struct adapter *sc) } /* + * Any params that need to be set before FW_INITIALIZE. + */ +static int +set_params__pre_init(struct adapter *sc) +{ + int rc = 0; + uint32_t param, val; + + if (chip_id(sc) >= CHELSIO_T6) { + param = FW_PARAM_DEV(HPFILTER_REGION_SUPPORT); + val = 1; + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); + /* firmwares < 1.20.1.0 do not have this param. */ + if (rc == FW_EINVAL && sc->params.fw_vers < + (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | + V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) { + rc = 0; + } + if (rc != 0) { + device_printf(sc->dev, + "failed to enable high priority filters :%d.\n", + rc); + } + } + + return (rc); +} + +/* * Retrieve various parameters that are of interest to the driver. The device * has been initialized by the firmware at this point. */ @@ -4118,20 +4149,6 @@ get_params__post_init(struct adapter *sc) sc->params.core_vdd = val[6]; if (chip_id(sc) >= CHELSIO_T6) { - -#ifdef INVARIANTS - if (sc->params.fw_vers >= - (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | - V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) { - /* - * Note that the code to enable the region should run - * before t4_fw_initialize and not here. This is just a - * reminder to add said code. - */ - device_printf(sc->dev, - "hpfilter region not enabled.\n"); - } -#endif sc->tids.tid_base = t4_read_reg(sc, A_LE_DB_ACTIVE_TABLE_START_INDEX);