From nobody Wed Apr 05 21:08:38 2023 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 4PsHKy5v5xz449Rl; Wed, 5 Apr 2023 21:08:38 +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 4PsHKy5RPyz4ktF; Wed, 5 Apr 2023 21:08:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680728918; 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=F7qw591ca66QUdTvHW89Rcm/wcMaM3Drve54w/MQsVk=; b=ePbFMBZp+PUWvw2alKfjYmLAFdeRoBCqAURoR4lxBAN6kfqeOFs5rI45vh26Pa35yR4oZh n5RmRw6M4W81k8JdxfIQW7U3vln3JM0hY6YaD+FdX4cJ4gXemK1NTbpZ/e3JHHEbTPdsFV TE5g7kP0hPKuooUBmMO0OImZGAHqMe9/d2GY36oqtEVDX9LmAaKNyIBTRBhRyk3fQSpDXH 3Rn5HOsuVmo33uhoDVEHFXMmVhXavB8/t2VlDrpPbSiGXx7ZTe/ayY9b5hFkv+HPLFlZWS rCHRNq1n+1aZhzicUJJpdQ5j1jN635jvQQdRXdGHxmwnnN7LZUBnZor3OMYhiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680728918; 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=F7qw591ca66QUdTvHW89Rcm/wcMaM3Drve54w/MQsVk=; b=PjMtshyG2h46MH/7fSYyHMcGI3p48HV3Qhbl3EdFDCh7d79FR9Tx6ICiBABR8sh/Rax4nt MnLR8r+jGTdoF61BLKM+lQ0iiOlQe0LRYxwB9wGhBitBDJzqIv2p4UCXKpWlz7kX5zAZH2 T6e42WpG9zBcefZFWXipEqlj//R2BO+socCUvFGCr75oWccmJAcso9WYpdVbiFWqQ5Ic0m xuZ1DvpkrvUJFKa2M1HM7YrffqSnjK+HaW6qvp8yJ46ZGhamips/OnNEJnXZG4R7DpqgGU TtuLsVv0QGHFZ7dG5k2KCgM4nvjBwjg4ZEEuiWf/CuRPeAHl5Vdvezh9o5GcxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1680728918; a=rsa-sha256; cv=none; b=rDJSwVdfVodD0Edbos7CTIc1gJ1RYuRcmYlEVcKM3OIM7enP0HnKLY62nQOtzwaJ5uCafr k7GmOYpKymXC9o3XBOUdFgHJabdugekn9dp1CErsYZeqDL18Lq25bHUfxt0opjQl/cyxQj Oqc+MgsafPM/dY49hFWicQMWk3L+QeT7jyma/OhxNkNmX8+MA4nPzKeG8lg2VnIbLrcCwd MLqkSHBjU9Qvas2mAV+al6q8bTY9T7kwV4i6F0vXjut1IxzhZIzsWFJpAAwpRiBqnCli0/ f4BO7rXW2pNDG9HF7D9X+C2revrhDvykWF69tiFGTCVIGVw9fefLjZm/JR1C3g== 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 4PsHKy4V8gzddy; Wed, 5 Apr 2023 21:08:38 +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 335L8cnJ043753; Wed, 5 Apr 2023 21:08:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 335L8ceq043752; Wed, 5 Apr 2023 21:08:38 GMT (envelope-from git) Date: Wed, 5 Apr 2023 21:08:38 GMT Message-Id: <202304052108.335L8ceq043752@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 5f6d37787f1e - main - netmap: Handle packet batches in generic mode 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f6d37787f1e6aaf9b18392e8cff65ed4e094f2c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5f6d37787f1e6aaf9b18392e8cff65ed4e094f2c commit 5f6d37787f1e6aaf9b18392e8cff65ed4e094f2c Author: Mark Johnston AuthorDate: 2023-04-05 20:52:41 +0000 Commit: Mark Johnston CommitDate: 2023-04-05 21:07:48 +0000 netmap: Handle packet batches in generic mode ifnets are allowed to pass batches of multiple packets to if_input, linked by the m_nextpkt pointer. iflib_rxeof() sometimes does this, for example. Netmap's generic mode did not handle this and would only deliver the first packet in the batch, leaking the rest. PR: 270636 Reviewed by: vmaffione MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39426 --- sys/dev/netmap/netmap_freebsd.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/dev/netmap/netmap_freebsd.c b/sys/dev/netmap/netmap_freebsd.c index e67d26d6788f..5a540b6c98b3 100644 --- a/sys/dev/netmap/netmap_freebsd.c +++ b/sys/dev/netmap/netmap_freebsd.c @@ -325,10 +325,17 @@ freebsd_generic_rx_handler(if_t ifp, struct mbuf *m) return; } - stolen = generic_rx_handler(ifp, m); - if (!stolen) { - NA(ifp)->if_input(ifp, m); - } + do { + struct mbuf *n; + + n = m->m_nextpkt; + m->m_nextpkt = NULL; + stolen = generic_rx_handler(ifp, m); + if (!stolen) { + NA(ifp)->if_input(ifp, m); + } + m = n; + } while (m != NULL); } /*