From nobody Mon Aug 08 18:22:25 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 4M1l0y3yf5z4YkXm; Mon, 8 Aug 2022 18:22:26 +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 4M1l0y1VPtz3XkC; Mon, 8 Aug 2022 18:22:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659982946; 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=PAxbupZ7oqeWDua8LcYrJ6FNNbjjv3lAL/MYf+gdZjA=; b=qnkPAlv4NXrGc40698D9vpGwCAioKPRcsDbkGni2atkWAe6Ta79pEKRI8UppOlBY+ziIfv u5RZR7dN3pOjk2K0sWVay8jRCUnlKCZbEA0oTVaVhcAlsHHg63IL3XnG4y9RfKjOQOB2+8 +6SbI2urfxWBNqq2ApGFm2jVmomY9bGu4BLSOioIC4Hiz28LUd0qXW/0dzgZ5JwIx/rwsK X6pZsYyIu+eW2F8clcHulIC2jFC/RlpgQ1zkuvWTm2HdyvNYcg5jSjpD+ZIzgAeLSC+U1s qEJUpNGTNIOErdUW7yN3at1Q3a4vw9coO0FuMZY1kfv3ThZUY4PwdZ7DYnIfXw== 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 4M1l0y0XqDz12Wn; Mon, 8 Aug 2022 18:22:26 +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 278IMPuh041960; Mon, 8 Aug 2022 18:22:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 278IMPQE041959; Mon, 8 Aug 2022 18:22:25 GMT (envelope-from git) Date: Mon, 8 Aug 2022 18:22:25 GMT Message-Id: <202208081822.278IMPQE041959@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: 782db2881b6b - main - cxgbe TOE TLS: Fix handling of unusual record types. 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: 782db2881b6b9c8460f7f311e0e4bbbab36eb88a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659982946; 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=PAxbupZ7oqeWDua8LcYrJ6FNNbjjv3lAL/MYf+gdZjA=; b=DpSaF0EPr7WxJM974usykuOZXFbzK3at3gT3iNIt637tkPMk6wZrZ7xvPV70usQ0v4QM80 16nFtWymB/6AfPjc5P8SSGK95yPkPNxMolo0pfnTFTUT19Hus1oQHNGLedayoh55KBAloD D7Ahlkh59mnO96ySAojh33/HA+NvvZ1TdGtCBA53LEJS3lCO7MtytNU5fVskQN6vaWALNG /+Yl45nk4Te8YGxxi0ExR2737YPVlQCr9TGUgqcAFORpVuupCvTHzplnnZdM+675+OPLvZ IwGQQfaMa9wv+1T5Q3pvh3IqZWnkxXb7X+kkwQVX0bKzNzhVlRbdUu9mqUzF4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659982946; a=rsa-sha256; cv=none; b=FtsKyDQTIIX867UM/npLA3fU/FKQlQhmlv7St6msy43smn/gmQknF9jlYAB/V74sZ9NhDY SjGnDrWzXPocfwj83ppF1sckhcplKbLR/AoYyJuzoLQZDOKHJweeljvPjDng2E+RP846pV YQ3Cx8ZtVyQHB6xo96ZoAPn3pdDtDjDnNrVtj6OaDL/T06wbLKcHQCv6MtxNbxWTkMeVo2 zHOMCozMKd/81SKriplSMiNkxMSt/XTDDKAfzh3INe+FfDv5rBPZ7gPQf+InfJ64SHQ1mN QIm9jpSZLeqs+5rFQRHxUSS/SvRlqqvRVYLtHmHdSYRtnG6f/X/s7U0mE/RT5g== 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=782db2881b6b9c8460f7f311e0e4bbbab36eb88a commit 782db2881b6b9c8460f7f311e0e4bbbab36eb88a 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: Fix handling of unusual record types. This doesn't matter for real traffic but fixes failures in the KTLS unit tests that use unusual record types. Sponsored by: Chelsio Communications --- sys/dev/cxgbe/tom/t4_tls.c | 14 +++++--------- sys/dev/cxgbe/tom/t4_tls.h | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index deb0c76836e4..447943b5b9db 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -129,11 +129,6 @@ tls_clr_ofld_mode(struct toepcb *toep) static inline unsigned char tls_content_type(unsigned char content_type) { - /* - * XXX: Shouldn't this map CONTENT_TYPE_APP_DATA to DATA and - * default to "CUSTOM" for all other types including - * heartbeat? - */ switch (content_type) { case CONTENT_TYPE_CCS: return CPL_TX_TLS_SFO_TYPE_CCS; @@ -141,10 +136,11 @@ tls_content_type(unsigned char content_type) return CPL_TX_TLS_SFO_TYPE_ALERT; case CONTENT_TYPE_HANDSHAKE: return CPL_TX_TLS_SFO_TYPE_HANDSHAKE; - case CONTENT_TYPE_HEARTBEAT: - return CPL_TX_TLS_SFO_TYPE_HEARTBEAT; + case CONTENT_TYPE_APP_DATA: + return CPL_TX_TLS_SFO_TYPE_DATA; + default: + return CPL_TX_TLS_SFO_TYPE_CUSTOM; } - return CPL_TX_TLS_SFO_TYPE_DATA; } /* TLS Key memory management */ @@ -545,7 +541,7 @@ write_tlstx_cpl(struct cpl_tx_tls_sfo *cpl, struct toepcb *toep, V_CPL_TX_TLS_SFO_DATA_TYPE(data_type) | V_CPL_TX_TLS_SFO_CPL_LEN(2) | V_CPL_TX_TLS_SFO_SEG_LEN(seglen)); cpl->pld_len = htobe32(plen); - if (data_type == CPL_TX_TLS_SFO_TYPE_HEARTBEAT) + if (data_type == CPL_TX_TLS_SFO_TYPE_CUSTOM) cpl->type_protover = htobe32( V_CPL_TX_TLS_SFO_TYPE(tls_hdr->type)); cpl->seqno_numivs = htobe32(tls_ofld->scmd0.seqno_numivs | diff --git a/sys/dev/cxgbe/tom/t4_tls.h b/sys/dev/cxgbe/tom/t4_tls.h index b5b25dd3c6d8..51bf566091e7 100644 --- a/sys/dev/cxgbe/tom/t4_tls.h +++ b/sys/dev/cxgbe/tom/t4_tls.h @@ -63,7 +63,7 @@ enum { CPL_TX_TLS_SFO_TYPE_ALERT, CPL_TX_TLS_SFO_TYPE_HANDSHAKE, CPL_TX_TLS_SFO_TYPE_DATA, - CPL_TX_TLS_SFO_TYPE_HEARTBEAT, /* XXX: Shouldn't this be "CUSTOM"? */ + CPL_TX_TLS_SFO_TYPE_CUSTOM, }; struct tls_scmd {