From nobody Fri Dec 27 17:06:30 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 4YKX2v4vRpz5j3Kr; Fri, 27 Dec 2024 17:06:31 +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 4YKX2v0Cqsz4vrb; Fri, 27 Dec 2024 17:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735319191; 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=sGiD2fs8p7cMAd4aXr8yCjoqSbFHzRR5H5tr9RhXmAg=; b=vDc/hvl6HAYaFOqdXVbhZ6m67e7aD9+47fUhFmXhzRTTt5AyZRZ3i/KSF71KYNk8o8Bt2g 9BiJ7XWwE1A3hCCTOjDzHw9XUjjBfKIArC34nhVMHlaQgc07tzs/OZuNOoPGrXBuI0U3Il V6t9a3V4SvoyXIvj0xHWPC3mj2O8P+5NhQeYXAF+2JURUdjQPbCOTSBD4KvzBdgVO4w+u/ a5aCgHDbtm63bB7PO7GB4DW+vjAZZosKT3Rydcv/ce7pQALCDeevdycGQQ4/UYO40lbE0p UzVFVnuIUJcdidkj/IFy5dDhbeRIczWJLHg9LlLKw11MIcxEfYMh3CnqnckJ7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735319191; 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=sGiD2fs8p7cMAd4aXr8yCjoqSbFHzRR5H5tr9RhXmAg=; b=DPh7hzA0ysnx3YaKj0qWcAZAQwS074JW/a1qZMcAp9q6017CxkRVPFYpnZIfMyW4xpaibc 3ac3qlepjsFSqtBGBpHkfpzjaXZnW/xNnSYZ08rOSgcHhZzbA+lvDXrAFBldfL3fNDx7/n v4sSnfLQl89R5EBMI/6XXHuRoKDKA0WxcAilUbhDUcrAvfhhOXGeKeGg4gvCmlunxvBojW PkLNu51a4fLTqbbYbT5UWKYzNZRBwYnrS78cB7ZDO5dHJ33bP2ysDBQoC/2XPDFSOAXlfA HA/ftSlqZVhXrZ2lke9xTH1KFrFIi9Pwpq1KB2IT7MBOk/jWOuVWpoQbvnEQJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735319191; a=rsa-sha256; cv=none; b=KeMlAdeV6f6sGNzV7kCBfEYDZkGbG9mq1D9Iqx2nQam8s5GDd9qPSrop0K25qvvck/tVIX DLkj62c9aGRamf3BcDRZuRBDHu8AOsTNvZaju3D6VutFE7Tj8lNoYDVeDOlihQ6q2YKA0I trLzNi1f48BxlgrY2ElL/AANGjPBcr96PuFSQsoH3fnmcjx2WSU2AGPF7d+3wRxrdbNA5w oH4NCm3UX//P6TOgosgnweBH290agpDgqplhhV4hAQehIINZKzctPAIDgCTrHR9Yj7rext hX9Hjck6uoZPBvEaMszdPdu70F+n5ECfHzWksTjiumpB4+qdPoz3bKl+kFbZ3A== 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 4YKX2t5nNBzmWm; Fri, 27 Dec 2024 17:06:30 +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 4BRH6UOc037694; Fri, 27 Dec 2024 17:06:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BRH6Uis037691; Fri, 27 Dec 2024 17:06:30 GMT (envelope-from git) Date: Fri, 27 Dec 2024 17:06:30 GMT Message-Id: <202412271706.4BRH6Uis037691@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: 1e87d76855ad - stable/14 - cxgbe tom: Restore support for zerocopy TCP receive for aio_read() 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e87d76855adf09da89700cb33f27acde6839741 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1e87d76855adf09da89700cb33f27acde6839741 commit 1e87d76855adf09da89700cb33f27acde6839741 Author: John Baldwin AuthorDate: 2024-12-11 02:13:51 +0000 Commit: John Baldwin CommitDate: 2024-12-27 15:52:55 +0000 cxgbe tom: Restore support for zerocopy TCP receive for aio_read() The commit to introduce TCP_USE_DDP support had a couple of bugs that broke support for zerocopy receive via aio_read(). First, the length and offset arguments to mk_update_tcb_for_ddp() were reversed which prevented DDP from working. Second, the AIO state in the toep was initialized too late when the first aio_read() request was queued. Reported by: Harshavardhan Tanneru @ Chelsio Fixes: eba13bbc37ab cxgbe: Support TCP_USE_DDP on offloaded TOE connections MFC after: 1 week Sponsored by: Chelsio Communications (cherry picked from commit 70693a45381b687e40ea30710aa38cb9f24b6b02) --- sys/dev/cxgbe/tom/t4_ddp.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index a08ddea00d05..7f0e9c46d2bf 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -2653,8 +2653,8 @@ sbcopy: * which will keep it open and keep the TCP PCB attached until * after the job is completed. */ - wr = mk_update_tcb_for_ddp(sc, toep, db_idx, &ps->prsv, ps->len, - job->aio_received, ddp_flags, ddp_flags_mask); + wr = mk_update_tcb_for_ddp(sc, toep, db_idx, &ps->prsv, + job->aio_received, ps->len, ddp_flags, ddp_flags_mask); if (wr == NULL) { recycle_pageset(toep, ps); aio_ddp_requeue_one(toep, job); @@ -2820,6 +2820,14 @@ t4_aio_queue_ddp(struct socket *so, struct kaiocb *job) return (EOPNOTSUPP); } + if ((toep->ddp.flags & DDP_AIO) == 0) { + toep->ddp.flags |= DDP_AIO; + TAILQ_INIT(&toep->ddp.cached_pagesets); + TAILQ_INIT(&toep->ddp.aiojobq); + TASK_INIT(&toep->ddp.requeue_task, 0, aio_ddp_requeue_task, + toep); + } + /* * XXX: Think about possibly returning errors for ENOTCONN, * etc. Perhaps the caller would only queue the request @@ -2834,14 +2842,6 @@ t4_aio_queue_ddp(struct socket *so, struct kaiocb *job) TAILQ_INSERT_TAIL(&toep->ddp.aiojobq, job, list); toep->ddp.waiting_count++; - if ((toep->ddp.flags & DDP_AIO) == 0) { - toep->ddp.flags |= DDP_AIO; - TAILQ_INIT(&toep->ddp.cached_pagesets); - TAILQ_INIT(&toep->ddp.aiojobq); - TASK_INIT(&toep->ddp.requeue_task, 0, aio_ddp_requeue_task, - toep); - } - /* * Try to handle this request synchronously. If this has * to block because the task is running, it will just bail