From owner-svn-src-head@freebsd.org Mon Feb 26 21:56:07 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 507ADF25DE9; Mon, 26 Feb 2018 21:56:07 +0000 (UTC) (envelope-from jhb@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 F20AC6BCF3; Mon, 26 Feb 2018 21:56:06 +0000 (UTC) (envelope-from jhb@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 E84D121331; Mon, 26 Feb 2018 21:56:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QLu6PI005124; Mon, 26 Feb 2018 21:56:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QLu6jg005122; Mon, 26 Feb 2018 21:56:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802262156.w1QLu6jg005122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 26 Feb 2018 21:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330040 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 330040 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: Mon, 26 Feb 2018 21:56:07 -0000 Author: jhb Date: Mon Feb 26 21:56:06 2018 New Revision: 330040 URL: https://svnweb.freebsd.org/changeset/base/330040 Log: Fetch TLS key parameters from the firmware. The parameters describe how much of the adapter's memory is reserved for storing TLS keys. The 'meminfo' sysctl now lists this region of adapter memory as 'TLS keys' if present. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Mon Feb 26 21:50:13 2018 (r330039) +++ head/sys/dev/cxgbe/offload.h Mon Feb 26 21:56:06 2018 (r330040) @@ -126,6 +126,7 @@ struct t4_virt_res { /* virtualiz struct t4_range srq; struct t4_range ocq; struct t4_range l2t; + struct t4_range key; }; enum { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Feb 26 21:50:13 2018 (r330039) +++ head/sys/dev/cxgbe/t4_main.c Mon Feb 26 21:56:06 2018 (r330040) @@ -3662,6 +3662,18 @@ get_params__post_init(struct adapter *sc) sc->vres.iscsi.start = val[0]; sc->vres.iscsi.size = val[1] - val[0] + 1; } + if (sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS) { + param[0] = FW_PARAM_PFVF(TLS_START); + param[1] = FW_PARAM_PFVF(TLS_END); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val); + if (rc != 0) { + device_printf(sc->dev, + "failed to query TLS parameters: %d.\n", rc); + return (rc); + } + sc->vres.key.start = val[0]; + sc->vres.key.size = val[1] - val[0] + 1; + } t4_init_sge_params(sc); @@ -7006,7 +7018,7 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) "TDDP region:", "TPT region:", "STAG region:", "RQ region:", "RQUDP region:", "PBL region:", "TXPBL region:", "DBVFIFO region:", "ULPRX state:", "ULPTX state:", - "On-chip queues:" + "On-chip queues:", "TLS keys:", }; struct mem_desc avail[4]; struct mem_desc mem[nitems(region) + 3]; /* up to 3 holes */ @@ -7142,6 +7154,13 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) md->base = sc->vres.ocq.start; if (sc->vres.ocq.size) md->limit = md->base + sc->vres.ocq.size - 1; + else + md->idx = nitems(region); /* hide it */ + md++; + + md->base = sc->vres.key.start; + if (sc->vres.key.size) + md->limit = md->base + sc->vres.key.size - 1; else md->idx = nitems(region); /* hide it */ md++;