From nobody Tue Nov 23 23:13:14 2021 X-Original-To: dev-commits-src-all@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 69E3518A2641; Tue, 23 Nov 2021 23:13: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 4HzKgd4fqCz3vvt; Tue, 23 Nov 2021 23:13:17 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 D19E41F4F9; Tue, 23 Nov 2021 23:13:14 +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 1ANNDEvm038143; Tue, 23 Nov 2021 23:13:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNDE4d038142; Tue, 23 Nov 2021 23:13:14 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:14 GMT Message-Id: <202111232313.1ANNDE4d038142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d7b47e163dc7 - stable/13 - ktls: Split encrypt vs decrypt OCF counters. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d7b47e163dc7bed63e10e231e0c38451f8787d1b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709198; 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=FU13Jdg/WhQNPM7hhVpg/OgWu3Ts23gKd2WB8tXdyp4=; b=icyK+Z5Be5hte/7mx4DIFS4Rpaf5XDaL/s6BcMknIXLWV0TTkfa5Ek+xAm+28p+d2HD/ar HCaSxcEJbp/KNeqht+O5i7MDeZEpa7XXJpW9odNNTY4XMh/0iFGxW7si/0w0HITVUj0xz/ sc/PAEkqLCJSfMxC0Ii2Yg5a2AO6RAazMdnh7t05k2//SuwkGCY0ZszEKyDbzeP+o6So/z DQiN1+F4rnK9JzHrmgB00Rl49+7/ARjMJ+bzBWgsbrG9hSH1vemEiSBFIx9XG9jxOQFEjq GD86c6jL9YCutHoQYmb3x4ht0cOiWZd1wM6O4bpMgAOsgZnjmQLdPp2bi58vqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709198; a=rsa-sha256; cv=none; b=TITJ2OOnNpDEb2tGEJ6uJzIY67tNmoAvXjRXa3oZxEQ/jzZWUeWT8vtw51/bPMokmRxWQT BJ+ekUsrO/RFBfErwHtgZfVyBjNrE3OeKzYqRZC0y0N2W6Oo3Dxcu/AXnFb/hENSUvGUEq RFyqvRGcQnctNP0dxc++CbcNfm3X+F3DkHuU1UGcMIb4yQiadYrQNq4Zo/qJiapIu70ywE WUvlqGcfRxdb7ZVjeChyHcbXs+V0z2HuwJbUpWbEHDo4ri87VlQroSqT8jLFZwlmht+rT3 0x8C0kOMZ8reJzStDi2aUWcJ//IcnCfe/CAWX5Z7RQZo60UOeti+BNi/ZaebaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d7b47e163dc7bed63e10e231e0c38451f8787d1b commit d7b47e163dc7bed63e10e231e0c38451f8787d1b Author: John Baldwin AuthorDate: 2021-11-16 17:58:52 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:54 +0000 ktls: Split encrypt vs decrypt OCF counters. Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D33006 (cherry picked from commit 16bea05ac3275d41663939da0d5c26d89f15cd53) --- sys/opencrypto/ktls_ocf.c | 62 +++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index f33af68dde8f..cbd1af6c6341 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -71,34 +71,44 @@ static SYSCTL_NODE(_kern_ipc_tls_stats, OID_AUTO, ocf, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Kernel TLS offload via OCF stats"); -static COUNTER_U64_DEFINE_EARLY(ocf_tls10_cbc_crypts); -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls10_cbc_crypts, - CTLFLAG_RD, &ocf_tls10_cbc_crypts, +static COUNTER_U64_DEFINE_EARLY(ocf_tls10_cbc_encrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls10_cbc_encrypts, + CTLFLAG_RD, &ocf_tls10_cbc_encrypts, "Total number of OCF TLS 1.0 CBC encryption operations"); -static COUNTER_U64_DEFINE_EARLY(ocf_tls11_cbc_crypts); -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls11_cbc_crypts, - CTLFLAG_RD, &ocf_tls11_cbc_crypts, +static COUNTER_U64_DEFINE_EARLY(ocf_tls11_cbc_encrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls11_cbc_encrypts, + CTLFLAG_RD, &ocf_tls11_cbc_encrypts, "Total number of OCF TLS 1.1/1.2 CBC encryption operations"); -static COUNTER_U64_DEFINE_EARLY(ocf_tls12_gcm_crypts); -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_gcm_crypts, - CTLFLAG_RD, &ocf_tls12_gcm_crypts, +static COUNTER_U64_DEFINE_EARLY(ocf_tls12_gcm_decrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_gcm_decrypts, + CTLFLAG_RD, &ocf_tls12_gcm_decrypts, + "Total number of OCF TLS 1.2 GCM decryption operations"); + +static COUNTER_U64_DEFINE_EARLY(ocf_tls12_gcm_encrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_gcm_encrypts, + CTLFLAG_RD, &ocf_tls12_gcm_encrypts, "Total number of OCF TLS 1.2 GCM encryption operations"); -static COUNTER_U64_DEFINE_EARLY(ocf_tls12_chacha20_crypts); -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_chacha20_crypts, - CTLFLAG_RD, &ocf_tls12_chacha20_crypts, +static COUNTER_U64_DEFINE_EARLY(ocf_tls12_chacha20_decrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_chacha20_decrypts, + CTLFLAG_RD, &ocf_tls12_chacha20_decrypts, + "Total number of OCF TLS 1.2 Chacha20-Poly1305 decryption operations"); + +static COUNTER_U64_DEFINE_EARLY(ocf_tls12_chacha20_encrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_chacha20_encrypts, + CTLFLAG_RD, &ocf_tls12_chacha20_encrypts, "Total number of OCF TLS 1.2 Chacha20-Poly1305 encryption operations"); -static COUNTER_U64_DEFINE_EARLY(ocf_tls13_gcm_crypts); -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls13_gcm_crypts, - CTLFLAG_RD, &ocf_tls13_gcm_crypts, +static COUNTER_U64_DEFINE_EARLY(ocf_tls13_gcm_encrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls13_gcm_encrypts, + CTLFLAG_RD, &ocf_tls13_gcm_encrypts, "Total number of OCF TLS 1.3 GCM encryption operations"); -static COUNTER_U64_DEFINE_EARLY(ocf_tls13_chacha20_crypts); -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls13_chacha20_crypts, - CTLFLAG_RD, &ocf_tls13_chacha20_crypts, +static COUNTER_U64_DEFINE_EARLY(ocf_tls13_chacha20_encrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls13_chacha20_encrypts, + CTLFLAG_RD, &ocf_tls13_chacha20_encrypts, "Total number of OCF TLS 1.3 Chacha20-Poly1305 encryption operations"); static COUNTER_U64_DEFINE_EARLY(ocf_inplace); @@ -297,9 +307,9 @@ ktls_ocf_tls_cbc_encrypt(struct ktls_session *tls, } if (os->implicit_iv) - counter_u64_add(ocf_tls10_cbc_crypts, 1); + counter_u64_add(ocf_tls10_cbc_encrypts, 1); else - counter_u64_add(ocf_tls11_cbc_crypts, 1); + counter_u64_add(ocf_tls11_cbc_encrypts, 1); if (inplace) counter_u64_add(ocf_inplace, 1); else @@ -415,9 +425,9 @@ ktls_ocf_tls12_aead_encrypt(struct ktls_session *tls, crypto_use_output_uio(&crp, &out_uio); if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) - counter_u64_add(ocf_tls12_gcm_crypts, 1); + counter_u64_add(ocf_tls12_gcm_encrypts, 1); else - counter_u64_add(ocf_tls12_chacha20_crypts, 1); + counter_u64_add(ocf_tls12_chacha20_encrypts, 1); if (inplace) counter_u64_add(ocf_inplace, 1); else @@ -485,9 +495,9 @@ ktls_ocf_tls12_aead_decrypt(struct ktls_session *tls, crypto_use_mbuf(&crp, m); if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) - counter_u64_add(ocf_tls12_gcm_crypts, 1); + counter_u64_add(ocf_tls12_gcm_decrypts, 1); else - counter_u64_add(ocf_tls12_chacha20_crypts, 1); + counter_u64_add(ocf_tls12_chacha20_decrypts, 1); error = ktls_ocf_dispatch(os, &crp); crypto_destroyreq(&crp); @@ -576,9 +586,9 @@ ktls_ocf_tls13_aead_encrypt(struct ktls_session *tls, memcpy(crp.crp_iv, nonce, sizeof(nonce)); if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) - counter_u64_add(ocf_tls13_gcm_crypts, 1); + counter_u64_add(ocf_tls13_gcm_encrypts, 1); else - counter_u64_add(ocf_tls13_chacha20_crypts, 1); + counter_u64_add(ocf_tls13_chacha20_encrypts, 1); if (inplace) counter_u64_add(ocf_inplace, 1); else