From owner-svn-src-head@freebsd.org Thu May 10 00:04:16 2018 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 06DBCFCFCA2; Thu, 10 May 2018 00:04:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD5CD75B7B; Thu, 10 May 2018 00:04:15 +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 8FF5B18963; Thu, 10 May 2018 00:04:15 +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 w4A04Fnr080772; Thu, 10 May 2018 00:04:15 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4A04FXL080770; Thu, 10 May 2018 00:04:15 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805100004.w4A04FXL080770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 10 May 2018 00:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333442 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 333442 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.25 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, 10 May 2018 00:04:16 -0000 Author: np Date: Thu May 10 00:04:14 2018 New Revision: 333442 URL: https://svnweb.freebsd.org/changeset/base/333442 Log: cxgbe(4): Determine whether the firmware supports the FILTER2 work request, which can be used to configure hardware NAT and swapmac. All firmwares released after Jan 2017 support this work request. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Wed May 9 21:50:20 2018 (r333441) +++ head/sys/dev/cxgbe/common/common.h Thu May 10 00:04:14 2018 (r333442) @@ -371,6 +371,7 @@ struct adapter_params { unsigned int bypass:1; /* this is a bypass card */ unsigned int ethoffload:1; unsigned int hash_filter:1; + unsigned int filter2_wr_support:1; unsigned int ofldq_wr_cred; unsigned int eo_wr_cred; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed May 9 21:50:20 2018 (r333441) +++ head/sys/dev/cxgbe/t4_main.c Thu May 10 00:04:14 2018 (r333442) @@ -3631,6 +3631,18 @@ get_params__post_init(struct adapter *sc) else sc->params.mps_bg_map = 0; + /* + * Determine whether the firmware supports the filter2 work request. + * This is queried separately for the same reason as MPSBGMAP above. + */ + param[0] = FW_PARAM_DEV(FILTER2_WR); + val[0] = 0; + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, param, val); + if (rc == 0) + sc->params.filter2_wr_support = val[0] != 0; + else + sc->params.filter2_wr_support = 0; + /* get capabilites */ bzero(&caps, sizeof(caps)); caps.op_to_write = htobe32(V_FW_CMD_OP(FW_CAPS_CONFIG_CMD) |