From nobody Tue Feb 01 15:24:17 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7413C1915ABC; Tue, 1 Feb 2022 15:24:19 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jp7yB43l3z3Fhb; Tue, 1 Feb 2022 15:24:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643729059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VrYkFJpMnIj8vHDM81l7EMTa5EENw57JZPjoHvChwvc=; b=GfH3eYAmaQnjcjlisYR+eSg+pyW3hQ6B37HNn56fyJAKSVCD484dKlfHzUJM4CC96I4f3e /Qy5FYHzPa6Ffz/Y3ZzZMVSjuYXx4/CzXGVcCi1IQ0rp9d5loFhtbMUULYzSY7VM8ugBl0 ADtepGC84wRnFgTKFVmYbl9gfnmDZ0nf+aSEZiB5sWjGFiD48b++7jTgDzvEN4xyCLvVhu 8Mfgc1xyar388u79p7rGfc27kVb8H68Q3k+SGwGCAkG53I8kZ9gDmreBFce1yKcldUFxHH Jq6lB5l506hhI9qEw0bhJqXIoKTAO7D2b2IoxoZxDXofyGAmDwirVKNmI+dx1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E067C1326E; Tue, 1 Feb 2022 15:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 211FOHSI050943; Tue, 1 Feb 2022 15:24:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 211FOHEf050942; Tue, 1 Feb 2022 15:24:17 GMT (envelope-from git) Date: Tue, 1 Feb 2022 15:24:17 GMT Message-Id: <202202011524.211FOHEf050942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 75767cb88997 - main - mlx5en: Share DEK objects with TLS RX. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75767cb88997b6b3fc99b2336de8398cff46db2a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643729059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VrYkFJpMnIj8vHDM81l7EMTa5EENw57JZPjoHvChwvc=; b=wQ32Nkq4C+0fsk4E4nCaSlOhyhH7EU5eG8GFRkZA0e1SekqbELcTU1gfcWrxkr3Ew3FhV9 pjii5hB7qQMAfGASyjCMyWGTop7363OSVfXGqTUY67hWV/G2HHoANhGLRkSqB+sFFxUAE+ JApXymmgFd/abyywYy/Q/diSRogWXr3DV00CalnsvFDIPZe7RDZ1PrIfn7pVUannR2zAH/ yitNyKb6SWVe9d3/RvjlnbMSeg0g0cuAkH7uYKKppR1QkVa9Phjz1AeocelFEt44xQY5MV HbV1O5IPy2C7oqsMBkn0l+gkAWDYwskIeFyaHlhgdCie+oGnWlHpr7usC0e5jA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643729059; a=rsa-sha256; cv=none; b=tya6AAWKgIHXuW77U1yNnS0kCHBMiM0LLnt5yc/krTWbnK+Xw7rloHYswtIvx3ncRjv9Tm fae5Vg4BU3s9Hrf9BFH2G/QMOqQHZVEwMakY1Tbhc20DYcSMFd8iQOCP982qfHCRWXDECu 7Ur9l/ZuW1nG3oMNEsUXWp/YQ3Bu1Ffcyk0oRKaauMPYDcGexmMZlUDIY3kVw73hwymFq8 eVngdI/lSnJ7lgAOC7ugQIKwEjS938DFA/l6nh22/QWSiSvv1AMLEvO9G0QQom2H0tmXeq 5wiOj5CEnC4phNowakAe22QTYphGnalsJmrl3zLtfmcDXbdTbV4VJfAjMEQdgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=75767cb88997b6b3fc99b2336de8398cff46db2a commit 75767cb88997b6b3fc99b2336de8398cff46db2a Author: Hans Petter Selasky AuthorDate: 2022-02-01 15:20:08 +0000 Commit: Hans Petter Selasky CommitDate: 2022-02-01 15:21:14 +0000 mlx5en: Share DEK objects with TLS RX. The TLS RX support also needs to be able to allocate DEK objects. Share the available objects 1:1. MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c index 01581693f744..f6ac2200f076 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c @@ -150,7 +150,8 @@ mlx5e_tls_init(struct mlx5e_priv *priv) struct sysctl_oid *node; uint32_t x; - if (MLX5_CAP_GEN(priv->mdev, tls_tx) == 0) + if (MLX5_CAP_GEN(priv->mdev, tls_tx) == 0 || + MLX5_CAP_GEN(priv->mdev, log_max_dek) == 0) return (0); ptls->wq = create_singlethread_workqueue("mlx5-tls-wq"); @@ -166,7 +167,8 @@ mlx5e_tls_init(struct mlx5e_priv *priv) sizeof(struct mlx5e_tls_tag), NULL, NULL, NULL, NULL, mlx5e_tls_tag_import, mlx5e_tls_tag_release, priv->mdev, 0); - ptls->max_resources = 1U << MLX5_CAP_GEN(priv->mdev, log_max_dek); + /* shared between RX and TX TLS */ + ptls->max_resources = 1U << (MLX5_CAP_GEN(priv->mdev, log_max_dek) - 1); for (x = 0; x != MLX5E_TLS_STATS_NUM; x++) ptls->stats.arg[x] = counter_u64_alloc(M_WAITOK); @@ -193,7 +195,7 @@ mlx5e_tls_cleanup(struct mlx5e_priv *priv) struct mlx5e_tls *ptls = &priv->tls; uint32_t x; - if (MLX5_CAP_GEN(priv->mdev, tls_tx) == 0) + if (ptls->init == 0) return; ptls->init = 0;