From nobody Wed Dec 11 02:24:10 2024 X-Original-To: dev-commits-src-main@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 4Y7KDB4Lqdz5gD5g; Wed, 11 Dec 2024 02:24:10 +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 4Y7KDB3NRCz44pQ; Wed, 11 Dec 2024 02:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733883850; 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=i2J57g32Bbqv+m7O6p5SNxw2DKWfUUiZ4VG6+KkM3Vk=; b=ttn0fG+khayFLjJBWEnhoRYn07+1GznEyilud8YaagrEeH+QY3x+H0TUNGhz2smPvSX7qA Ngdc/qhcBMwimPlJWLCJImLClPIe1bckcj8ABWJPv1xlrDpw0WBiTetQ7n1VVvjNJnfYmW YGOBjSPhJefkud93+Z2B09V1ok77fVHkIWM9A/Pb+Cabk0MNgJJQV2p/+ABZEsMOme2uSM mvGnb1AdAHauOx9392mwJYBmH2EzdkuDMuoblMHyrW5M90VvxqT5wygJ42vOehhLl4m6H9 nWK5KDjz4RKJ76p1GsyKadQA/CdhP19TFGz49+9O5gw6yvd8WKOPU+VIj8Nr0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733883850; 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=i2J57g32Bbqv+m7O6p5SNxw2DKWfUUiZ4VG6+KkM3Vk=; b=duWnzGOsLR5Fm2LblT6EfhqlHTSJ+4tGbejcpaV2KAG9nSY5h9fyi+vJ57h3DK7dE/YZEF 6aDM2QMyPJV95GtJZet3dixbiNByaCetzcDww4AEiGtPqFEmf5ngFoiBM1v745r5tNzCgu sgfYfxPKHAKc/ej0UuldR7zxxBA+NXowQpLKEMQWmVzEo+OzAQk9WO6IQ35ZAO5VslcuSr GfihTcWcOsgaz/5pmxNa2wHSXW0r3Xf8+445CbsgJZ8rnfN3iVUgfDaynZ4FpigBo87iBo wpKIVS5RJ5CDgWBTsZrPbw1vbUtZlVjseAQzFCG1zR6uZj85I2/Oo8MshF4e6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733883850; a=rsa-sha256; cv=none; b=W6R/ONul/rh2173LJRgyV/vCYyv4DU3rmecmaYWO19fYF8O2CYY1RniLGj53vShto1Rhcd GuZrAYqbcFyJgrGQuRD616cziviMsktzqpSAbG6fd/N4oeotKASiAPgqoPXkLb+pFmmXE6 0H1WvxEKKXh1ge5mR+KfOP6UmP6VmVvhjSVYo7Mm6RiRYmdH+ozWEVxe7nxh03C/duWATR vlU6IR/mdZqXXoRNJy0o+IgZG9HUpiZy0Be7s9dvtDZic/5zi/uI6pMOLGz9kApgjXvv3z rv+MOqh6XmzVy86xvCfSeXV9hIw9Wtl6rXSNn/ynbAzQBuvWTxVIF8i8QgM7pA== 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 4Y7KDB2hG3zpmY; Wed, 11 Dec 2024 02:24:10 +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 4BB2OAuY035552; Wed, 11 Dec 2024 02:24:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BB2OA3O035549; Wed, 11 Dec 2024 02:24:10 GMT (envelope-from git) Date: Wed, 11 Dec 2024 02:24:10 GMT Message-Id: <202412110224.4BB2OA3O035549@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: 70693a45381b - main - cxgbe tom: Restore support for zerocopy TCP receive for aio_read() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 70693a45381b687e40ea30710aa38cb9f24b6b02 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=70693a45381b687e40ea30710aa38cb9f24b6b02 commit 70693a45381b687e40ea30710aa38cb9f24b6b02 Author: John Baldwin AuthorDate: 2024-12-11 02:13:51 +0000 Commit: John Baldwin CommitDate: 2024-12-11 02:23:47 +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 --- 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 529fc2a5b825..2fee8fa91dac 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