From nobody Tue May 13 14:11:48 2025 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 4Zxdh430WTz5vPhf; Tue, 13 May 2025 14:11:48 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zxdh42XG2z3RL7; Tue, 13 May 2025 14:11:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747145508; 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=X6ViER4UIu2gbvVHkKTKLsgRNOzIzqhVUL/HgMFYGRs=; b=I6R2IUNdL5KTeADcPko4achgkNNVzYxNHpHz/4zaY+7uRlFAaPoKQRuFcvN/karU0H2+jB VvynOF8OFFK5PYcZov+wHrTfhKZpxVSOZI0291rBrYzLidc/Mg8h0ROdV498VeSoU+YCk/ tn7qWY6AoAkt7U5EBl2EqjDL6cYNWmTAqbNr1aKXtrSCn0l4fAsADCoxA4N+T9+VW1AkH0 8b5oip+BQyLvBqsJFlpTb6p51qEn1QMwjsv2HpSNIk4r2HrmJV8EcIF7Lk9536AfQ60qCu kkjJ8wlvcy2eOLzxflFT3wm2VlQxnDNTbrr1/ZXa66VMG7Bl4WHIkQIDcMGijw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747145508; 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=X6ViER4UIu2gbvVHkKTKLsgRNOzIzqhVUL/HgMFYGRs=; b=nuXxU+Td3g1iHxWeff3sIuCZGoiE/W2hGpO7GncFZXSPX3e0ZHEaQSoSxblPnwtuO0QkK3 TZj5uSeNARCzFw9YFTS9NNgWwliAIkAJsbTarRJcVHXjzOVdyP4PmOAq29OjyGSeOXO/un 5D7DfiYFXU+2mLcX7bRwWZOk4fnaZrjEsy8neW9EzAhqcizHQCcxhnIeuLUw3QiiE4Q5EC eTgd6jXePfJIAqY+FrIcUAStgc7Yh3w8rf2R0WDJ77q38TUT1vY9wCMTKhbPhLb1Cbct9A 1PVnrPTTdGXxHsErJ5+PxtmskbV19XmXEiDLDPW6uti0LPpkzUtCz++wm9iF1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747145508; a=rsa-sha256; cv=none; b=V/oKsS5Oe3CDnIjT3BmlUeNzM0H24SrnQ6w1jhLZdWXORdhutX5N2TZkdfda+WYICgFk+u uVvkOKmA7S2f2r+tQMvshdf1ZnPKqEvANPmanyhx1mhrgsuaKaKt8B6SN5c3uvjJUTPz9p eNOzHZJSYzPG+2LrP56DwwMSFH515i4iD9wCFVVlNZub68ToltDiI5gKo53Ae6V+0t2NPS /Y9SZMKNG5R7DNfTYXXRDGuqlgfDgHRsB5CdsAfPPdNO0t3REbiFpEIObDc/QpAgXVmn7z MXy2wR6kou7g9vo+TAkcLCoMNm5DWcy6ZLlGD0hWzl+mpuC9Dr/85wy6cQaWKw== 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 4Zxdh424zPzqGj; Tue, 13 May 2025 14:11:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 54DEBmCj040833; Tue, 13 May 2025 14:11:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54DEBmk3040830; Tue, 13 May 2025 14:11:48 GMT (envelope-from git) Date: Tue, 13 May 2025 14:11:48 GMT Message-Id: <202505131411.54DEBmk3040830@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: 2befd0658832 - main - cxgbe nic TLS: Fix requests with 8 bytes of immediate data padding 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 2befd06588325c541d400fcc4915a1adfd1c7d17 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2befd06588325c541d400fcc4915a1adfd1c7d17 commit 2befd06588325c541d400fcc4915a1adfd1c7d17 Author: John Baldwin AuthorDate: 2025-05-13 13:57:18 +0000 Commit: John Baldwin CommitDate: 2025-05-13 14:05:09 +0000 cxgbe nic TLS: Fix requests with 8 bytes of immediate data padding Requests whose immediate data do not end on a 16-byte boundary are padded with zeroes before the next WR command. Since ULP commands are 8 byte aligned, if there are more than 8 bytes of padding, the immediate data is padded with zeroes up to an 8 byte boundary and the last 8 bytes contain a ULP NOOP command. In the case of exactly 8 bytes of padding, the result should be that no zeroes are inserted, only the ULP NOOP. However, the code was actually inserting 8 bytes of zero padding followed by the ULP NOOP causing the following real command to be misaligned. Fix this by skipping the zero padding if there exactly 8 padding bytes. Reported by: Sony Arpita Das @ Chelsio Sponsored by: Chelsio Communications --- sys/dev/cxgbe/crypto/t6_kern_tls.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/crypto/t6_kern_tls.c b/sys/dev/cxgbe/crypto/t6_kern_tls.c index 167eb77da942..897773d2d867 100644 --- a/sys/dev/cxgbe/crypto/t6_kern_tls.c +++ b/sys/dev/cxgbe/crypto/t6_kern_tls.c @@ -1793,9 +1793,11 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, void *dst, } if (imm_len % 16 != 0) { - /* Zero pad to an 8-byte boundary. */ - memset(out, 0, 8 - (imm_len % 8)); - out += 8 - (imm_len % 8); + if (imm_len % 8 != 0) { + /* Zero pad to an 8-byte boundary. */ + memset(out, 0, 8 - (imm_len % 8)); + out += 8 - (imm_len % 8); + } /* * Insert a ULP_TX_SC_NOOP if needed so the SGL is