From nobody Mon Aug 08 18:22:24 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 4M1l0x1hWcz4YkCB; Mon, 8 Aug 2022 18:22:25 +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 4M1l0x0Xqwz3XXV; Mon, 8 Aug 2022 18:22:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659982945; 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=qKjCa9jlPFuPZuto143UkhtNKB8zk/2r54JhTCEJp5Y=; b=nu8aNnjwqN+pn+UOgjUM9//neC6tgbDNT2fAx1TcowtsxGBQBZAQAv6C4RZj4CPo7NRhnW tFHkmlmhMw4tin8+4nQj1OLvmMPDJ+xPBEsPzctC0aRUmXwEO/E3RCP6YSVGa2O4Yqtiq1 Xz+L4Cy1Vd1ZJCfWr+ZTMstWgKe7sncpsa4ziUM3hOuIGRUCbtR4Lqnih7GZ4vXEDjiceZ lBBDN6BBbYdeJ266Sgc2469/ltj81ppPj9774LRM1FXzw5roYoW7ZNfgKRbKDR0VSeETVR GAeKM/MBlTz38P37qhDVTTs3CQ5/nGy+Ay83W9ijNy+NcxYYKKURnnryXQn5rg== 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 4M1l0w6fTCz12Tg; Mon, 8 Aug 2022 18:22:24 +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 278IMOf0041936; Mon, 8 Aug 2022 18:22:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 278IMO9A041935; Mon, 8 Aug 2022 18:22:24 GMT (envelope-from git) Date: Mon, 8 Aug 2022 18:22:24 GMT Message-Id: <202208081822.278IMO9A041935@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c6b3a3772c08 - main - 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/main X-Git-Reftype: branch X-Git-Commit: c6b3a3772c0872f625ebb43d6a334babc5def5f4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659982945; 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=qKjCa9jlPFuPZuto143UkhtNKB8zk/2r54JhTCEJp5Y=; b=EOeCmYEBgyiNhwMIBRVj/+nedM8qmuQDHjcSzvf/K7EB3cCTJDqgelxKiZEDAlwhHIeuJE /q40CCNmW5zKQ7NV2cRJk5ngJ+2b8k7aNaWegLPMS3QV/mxDcUzcucMB5SoV2AvsuA2A6l 5ctbMEgTjTFfAhOYcbL82kwA4+IaOYVLUynQQ4+ubfh8cFmbU8rZNizu05mpPKPQni9LpG U+pa6VWiEfvHJ6Q9wylbQu2QwDCFjXscq0CDNIn+seL7CMBnWJip7Re9H/krrnaYwJ11qm KpZoK9Whip5o33T3lrd/+fbiyoUGkCO09tRIjIIfx4tmYPOGXjbE3jF332sPYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659982945; a=rsa-sha256; cv=none; b=tA+Tp8QBoFr5y0rMlH8P5WsXr/w99BCHbc5C5p4BFI1mZMmIkRXpDHFniFJ+3qdSyeBySM 0GXgnHub0oJ7ykErBEYteTXeyX29HJFD1USBKIrDAfUz8EtSzTcM2buFB3ccyxCZ8KaC+J KDdIbUcqclfnv1Epld/vU6+kdl/J2zsNTYZDFyLKitQDanDvRhnNfbV4L63aXev1h+l9HS mad9NxLxibQuH7ywaYibnlO630e1U/OP8hTtS9oRKgTmYp2NYH8npDgbN26A/n7XZFY35c NQ6BNC8vbXneh1D0UaOdAkoS04ZJWoxqjpiY7EYSlE53HcQtoYAQp9EXX2mjJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c6b3a3772c0872f625ebb43d6a334babc5def5f4 commit c6b3a3772c0872f625ebb43d6a334babc5def5f4 Author: John Baldwin AuthorDate: 2022-08-08 18:21:54 +0000 Commit: John Baldwin CommitDate: 2022-08-08 18:21:54 +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 --- 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 eb540406a271..deb0c76836e4 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -400,11 +400,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 + @@ -509,24 +505,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( @@ -539,15 +534,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) | @@ -557,10 +549,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 @@ -820,10 +811,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 e5166bf6d9bd..b5b25dd3c6d8 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;