From nobody Sat Nov 02 13:54:55 2024 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 4XgfPD2TfDz5c46V; Sat, 02 Nov 2024 13:54:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgfPC5W0lz40HG; Sat, 2 Nov 2024 13:54:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730555695; 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=AjawA0cuy7+mMpVI13ncofqetwFhS+qEpK9J3IRzfBM=; b=Vhc4VTaivCOZCxHP9lq3SFLXMVvoUkYwO0NsM4JMwuSl1h/kspfn9Y1s3NhDCrXT5IMTZ6 0cGpwOTd1iqemFqiugNysqP9n0ZflnIF5mgqiUs2f4WFCzjVCcjQfnqhf62ClibfL6YIWd yLZ2ruFvMN4VZZedy2twnb5hI7PozqYdwKle7GJ/uzK6GnXlyMhti6Ll0CcQFRynhdW9Cp 6ycr52kHAQ91O8vH3Vrh0K3OtrV1+O2zAD6vopzAwrijEXLcBYn7yBHVGpeN/DilnZjEMg adxHAgH0uVfrTjPOiU58RSRuvp1skbEHToki2ejN0xboEGgg/ugjaSowMDGe/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730555695; 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=AjawA0cuy7+mMpVI13ncofqetwFhS+qEpK9J3IRzfBM=; b=hKFl526r/+QK/157fEl2iqOeN7zw/abJuXtl7mKwfLJco+Ue1Go/a2oaV7iK8IRWLGcq08 RJ3YFE4DLNZY9lUs8flaF9va2AlOAoYDEsOSFytJ4swCRAWRkoKPRTKJtNYdLAJPOpOrqn n690eyKlm9wlaGvX9esclp3ou9RRny+Q90v5h/g4kCVmo1resdz5FyvrFua5Ij3lKLrbTP l6/mazajaS5WAwf3+CO7p8wITk3BJ90yvmJwBANqKwxzBw0dlYESPq3CRSxusW7KH6rZNg bIZu7t3jtX+252TF0SZ6S4JgHrR+l1dkXJCGyk6Q5abxd578QyByxidv9TR5gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730555695; a=rsa-sha256; cv=none; b=UPdbAK2Jt2JSN2tXfZkxEMUNHeQN6XnKIh0lBT7tax64Yn3UkikKwmb7bB9bl3PIZyxbZ2 sqUnndeTAj0KuTWEtFTYxIPybVbPxddMKX8EgumL20Rrf810kmCkKRXC3/7Xn0vdWQt0aI q0E0boxBODMdE2XD5gHSTZA0DP1ve+Y6yUzCbkgszcUxtUqx41KckYkuv8ww9wR0N2Q0Lf BodY60VNROOfLEXgFHVoeP9kkKa9jaDAkH13hHnhkixgEM8qO6Z6hjTcV6AP9h/vIYoX/e rAoeLgPA7F1VsqzD7sCFzAvpFy+HnvPth53pMYe1OaXqGDoN4K4tsOBM610YZw== 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 4XgfPC56zzz16q9; Sat, 2 Nov 2024 13:54:55 +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 4A2DstD3098949; Sat, 2 Nov 2024 13:54:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2DstIQ098946; Sat, 2 Nov 2024 13:54:55 GMT (envelope-from git) Date: Sat, 2 Nov 2024 13:54:55 GMT Message-Id: <202411021354.4A2DstIQ098946@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: 06b2ed7a3adf - main - nvmf_tcp: Correct padding calculation 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: 06b2ed7a3adf023d8a8ce821616052f03dc18ed6 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=06b2ed7a3adf023d8a8ce821616052f03dc18ed6 commit 06b2ed7a3adf023d8a8ce821616052f03dc18ed6 Author: John Baldwin AuthorDate: 2024-11-02 13:54:29 +0000 Commit: John Baldwin CommitDate: 2024-11-02 13:54:29 +0000 nvmf_tcp: Correct padding calculation PDU data alignment (PDA) isn't necessarily a power of 2, just a multiple of 4, so use roundup() instead of roundup2() to compute the PDU data offset (PDO). Sponsored by: Chelsio Communications --- lib/libnvmf/nvmf_tcp.c | 2 +- sys/dev/nvmf/nvmf_tcp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libnvmf/nvmf_tcp.c b/lib/libnvmf/nvmf_tcp.c index cc4c0b90b0fb..264a5bb154a0 100644 --- a/lib/libnvmf/nvmf_tcp.c +++ b/lib/libnvmf/nvmf_tcp.c @@ -432,7 +432,7 @@ nvmf_tcp_construct_pdu(struct nvmf_tcp_qpair *qp, void *hdr, size_t hlen, if (qp->header_digests) plen += sizeof(header_digest); if (data_len != 0) { - pdo = roundup2(plen, qp->txpda); + pdo = roundup(plen, qp->txpda); pad = pdo - plen; plen = pdo + data_len; if (qp->data_digests) diff --git a/sys/dev/nvmf/nvmf_tcp.c b/sys/dev/nvmf/nvmf_tcp.c index 2e33334b92ee..50adbfdd2917 100644 --- a/sys/dev/nvmf/nvmf_tcp.c +++ b/sys/dev/nvmf/nvmf_tcp.c @@ -442,7 +442,7 @@ nvmf_tcp_construct_pdu(struct nvmf_tcp_qpair *qp, void *hdr, size_t hlen, plen += sizeof(digest); if (data_len != 0) { KASSERT(m_length(data, NULL) == data_len, ("length mismatch")); - pdo = roundup2(plen, qp->txpda); + pdo = roundup(plen, qp->txpda); pad = pdo - plen; plen = pdo + data_len; if (qp->data_digests)