Date: Mon, 26 Feb 2018 21:56:06 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330040 - head/sys/dev/cxgbe Message-ID: <201802262156.w1QLu6jg005122@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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++;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802262156.w1QLu6jg005122>