From owner-svn-src-head@freebsd.org Wed Sep 13 06:07:03 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 D049BE0E84E; Wed, 13 Sep 2017 06:07:03 +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 92283748B4; Wed, 13 Sep 2017 06:07:03 +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 v8D6723q048066; Wed, 13 Sep 2017 06:07:02 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8D672Ib048065; Wed, 13 Sep 2017 06:07:02 GMT (envelope-from np@FreeBSD.org) Message-Id: <201709130607.v8D672Ib048065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 13 Sep 2017 06:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323520 - 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: 323520 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, 13 Sep 2017 06:07:03 -0000 Author: np Date: Wed Sep 13 06:07:02 2017 New Revision: 323520 URL: https://svnweb.freebsd.org/changeset/base/323520 Log: cxgbe(4): Ignore capabilities that depend on TOE when the firmware reports TOE is not available. 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 Wed Sep 13 04:32:23 2017 (r323519) +++ head/sys/dev/cxgbe/t4_main.c Wed Sep 13 06:07:02 2017 (r323520) @@ -3576,6 +3576,18 @@ get_params__post_init(struct adapter *sc) READ_CAPS(iscsicaps); READ_CAPS(fcoecaps); + /* + * The firmware attempts memfree TOE configuration for -SO cards and + * will report toecaps=0 if it runs out of resources (this depends on + * the config file). It may not report 0 for other capabilities + * dependent on the TOE in this case. Set them to 0 here so that the + * driver doesn't bother tracking resources that will never be used. + */ + if (sc->toecaps == 0) { + sc->iscsicaps = 0; + sc->rdmacaps = 0; + } + if (sc->niccaps & FW_CAPS_CONFIG_NIC_ETHOFLD) { param[0] = FW_PARAM_PFVF(ETHOFLD_START); param[1] = FW_PARAM_PFVF(ETHOFLD_END);