From nobody Fri Nov 11 00:39:07 2022 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 4N7fwC3F1xz4db8K; Fri, 11 Nov 2022 00:39:07 +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 4N7fwC2QvSz4chy; Fri, 11 Nov 2022 00:39:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668127147; 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=Vz8mDI6/ZoAwSQ0NTbRuLCrvt4kDFCTKlyKNkBFVPDI=; b=i2os9jZYdcNwgi9VO01WcOoJQEi/uqiEIW8wtz+tTwAuVtpJ395Dc9MdY0DORWaZETbxKU 2YMM9Mr1m0RpeM2ZsIbZQZgNKCddVQsp9PXyOqCP9nGKc6nvTy1TE0/HMXLiaanpvZ0A1z 4skIxllER03CncayCcSsfl6kWv9Ra/0+S58EfLJpGXW5CmrPw0U6SYp2arOGYvVdnELTRI k90tZwjAfPs3qFhhNPj9svM0KhGq3dUrecI0VWwmWewuYPiwXHn9ffyLBqxmbNrObRNCM8 w6S2F/TjRsISksfn5DwcfoFltmsuj/hqIzl96F5rIC5692S44OfFeU6ViFN0Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668127147; 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=Vz8mDI6/ZoAwSQ0NTbRuLCrvt4kDFCTKlyKNkBFVPDI=; b=UGI2tpixkUm06Cu3LEru4Y/0708UKRp2wvnjAh20NPtlPAk5mqnUXDznS9U63ioAci2Gds cxJ0CBwb4T+F8H2qKXlLNwp7ZRKyFJ90dQ3e85PuPxsNiLlTJ4d0CqG54yAWJ8Ewgsb3jf l7uD2OrvtI6qBGC9bho08F1IuQ8ifuxPGO7AWE9m5wsr6/EM4OzDZvEmQbSTd1G8A5RoGv SBg0+QXVcOlcyx9cwTC49Zq0UiwN6CALaSiQlYLLDepEAukwM61hqyfIdwtCq1ZGpikviE 6Vvg9tyrHTM5FkTj1aU9ac2h6DtUHwrE/13Od3PRz289wHHom9h67QdJnUv3IA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668127147; a=rsa-sha256; cv=none; b=Nb6Fa0L73MC3LT1L3BwO1LoXfe+4qG3cUXQVmhbLW675YPQ7l2Edw2b56jDs2VVp44g6CP DTosSBekDaORIUD6taftR7DqEFgCgxRg0SZHkMr0R03nFRfDu4/y5wtNwuXnS43zYp+/St pvPDgB5rX73K3vUaeVa41j0DYF/va+tzry2vP9sTZM/WA8M51dsFdoZL/UX2NiQTn4328z UGlNxARqj41b0l85eJIWWLEiy7s0l3qHY6Ft5ZNKcEZOGIY2C6GRVsJPkTYAbW8OKP5Bzh iw16xZr1eh0InM7XjviLdNcMhE5CGhgr3qJWHXmjrC2moWTujY4IIIyHQDhmuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4N7fwC0rMvzMLS; Fri, 11 Nov 2022 00:39:07 +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 2AB0d7wM057378; Fri, 11 Nov 2022 00:39:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AB0d7Bs057377; Fri, 11 Nov 2022 00:39:07 GMT (envelope-from git) Date: Fri, 11 Nov 2022 00:39:07 GMT Message-Id: <202211110039.2AB0d7Bs057377@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: 56dad65305af - stable/13 - cxgbe TOE TLS: Simplify a few routines. 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: 56dad65305af5037d11f4cada43931def31b68cb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=56dad65305af5037d11f4cada43931def31b68cb commit 56dad65305af5037d11f4cada43931def31b68cb Author: John Baldwin AuthorDate: 2022-08-08 18:21:54 +0000 Commit: John Baldwin CommitDate: 2022-11-11 00:36:01 +0000 cxgbe TOE TLS: Simplify a few routines. Remove a few more remnants from the old pre-KTLS support and instead assume that each work request sends a single TLS record. Sponsored by: Chelsio Communications (cherry picked from commit c6b3a3772c0872f625ebb43d6a334babc5def5f4) --- sys/dev/cxgbe/tom/t4_tls.c | 33 +++++++++++---------------------- sys/dev/cxgbe/tom/t4_tls.h | 1 - 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index eb24e10289db..18b9857ad1dc 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -396,11 +396,7 @@ tls_alloc_ktls(struct toepcb *toep, struct ktls_session *tls, int direction) V_SCMD_KEY_CTX_INLINE(0) | V_SCMD_TLS_FRAG_ENABLE(1)); - if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) - toep->tls.iv_len = 8; - else - toep->tls.iv_len = AES_BLOCK_LEN; - + toep->tls.iv_len = explicit_iv_size; toep->tls.frag_size = tls->params.max_frame_len; toep->tls.fcplenmax = get_tp_plen_max(tls); toep->tls.expn_per_ulp = tls->params.tls_hlen + @@ -505,24 +501,23 @@ tls_uninit_toep(struct toepcb *toep) static void write_tlstx_wr(struct fw_tlstx_data_wr *txwr, struct toepcb *toep, - unsigned int immdlen, unsigned int plen, unsigned int expn, - unsigned int pdus, uint8_t credits, int shove, int imm_ivs) + unsigned int plen, unsigned int expn, uint8_t credits, int shove) { struct tls_ofld_info *tls_ofld = &toep->tls; unsigned int len = plen + expn; txwr->op_to_immdlen = htobe32(V_WR_OP(FW_TLSTX_DATA_WR) | V_FW_TLSTX_DATA_WR_COMPL(1) | - V_FW_TLSTX_DATA_WR_IMMDLEN(immdlen)); + V_FW_TLSTX_DATA_WR_IMMDLEN(0)); txwr->flowid_len16 = htobe32(V_FW_TLSTX_DATA_WR_FLOWID(toep->tid) | V_FW_TLSTX_DATA_WR_LEN16(credits)); txwr->plen = htobe32(len); txwr->lsodisable_to_flags = htobe32(V_TX_ULP_MODE(ULP_MODE_TLS) | V_TX_URG(0) | /* F_T6_TX_FORCE | */ V_TX_SHOVE(shove)); - txwr->ctxloc_to_exp = htobe32(V_FW_TLSTX_DATA_WR_NUMIVS(pdus) | + txwr->ctxloc_to_exp = htobe32(V_FW_TLSTX_DATA_WR_NUMIVS(1) | V_FW_TLSTX_DATA_WR_EXP(expn) | V_FW_TLSTX_DATA_WR_CTXLOC(TLS_SFO_WR_CONTEXTLOC_DDR) | - V_FW_TLSTX_DATA_WR_IVDSGL(!imm_ivs) | + V_FW_TLSTX_DATA_WR_IVDSGL(0) | V_FW_TLSTX_DATA_WR_KEYSIZE(tls_ofld->tx_key_info_size >> 4)); txwr->mfs = htobe16(tls_ofld->frag_size); txwr->adjustedplen_pkd = htobe16( @@ -535,15 +530,12 @@ write_tlstx_wr(struct fw_tlstx_data_wr *txwr, struct toepcb *toep, static void write_tlstx_cpl(struct cpl_tx_tls_sfo *cpl, struct toepcb *toep, - struct tls_hdr *tls_hdr, unsigned int plen, unsigned int pdus) + struct tls_hdr *tls_hdr, unsigned int plen, uint64_t seqno) { struct tls_ofld_info *tls_ofld = &toep->tls; int data_type, seglen; - if (plen < tls_ofld->frag_size) - seglen = plen; - else - seglen = tls_ofld->frag_size; + seglen = plen; data_type = tls_content_type(tls_hdr->type); cpl->op_to_seg_len = htobe32(V_CPL_TX_TLS_SFO_OPCODE(CPL_TX_TLS_SFO) | V_CPL_TX_TLS_SFO_DATA_TYPE(data_type) | @@ -553,10 +545,9 @@ write_tlstx_cpl(struct cpl_tx_tls_sfo *cpl, struct toepcb *toep, cpl->type_protover = htobe32( V_CPL_TX_TLS_SFO_TYPE(tls_hdr->type)); cpl->seqno_numivs = htobe32(tls_ofld->scmd0.seqno_numivs | - V_SCMD_NUM_IVS(pdus)); + V_SCMD_NUM_IVS(1)); cpl->ivgen_hdrlen = htobe32(tls_ofld->scmd0.ivgen_hdrlen); - cpl->scmd1 = htobe64(tls_ofld->tx_seq_no); - tls_ofld->tx_seq_no += pdus; + cpl->scmd1 = htobe64(seqno); } static int @@ -816,10 +807,8 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) expn_size = m->m_epg_hdrlen + m->m_epg_trllen; tls_size = m->m_len - expn_size; - write_tlstx_wr(txwr, toep, 0, - tls_size, expn_size, 1, credits, shove, 1); - toep->tls.tx_seq_no = m->m_epg_seqno; - write_tlstx_cpl(cpl, toep, thdr, tls_size, 1); + write_tlstx_wr(txwr, toep, tls_size, expn_size, credits, shove); + write_tlstx_cpl(cpl, toep, thdr, tls_size, m->m_epg_seqno); idata = (struct ulptx_idata *)(cpl + 1); idata->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_NOOP)); diff --git a/sys/dev/cxgbe/tom/t4_tls.h b/sys/dev/cxgbe/tom/t4_tls.h index 955202b45078..51bf566091e7 100644 --- a/sys/dev/cxgbe/tom/t4_tls.h +++ b/sys/dev/cxgbe/tom/t4_tls.h @@ -76,7 +76,6 @@ struct tls_ofld_info { int key_location; int rx_key_addr; int tx_key_addr; - uint64_t tx_seq_no; uint16_t rx_version; unsigned short fcplenmax; unsigned short adjusted_plen;