From nobody Thu Jul 27 05:37:12 2023 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 4RBKK43wmlz4ph6R; Thu, 27 Jul 2023 05:37:12 +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 4RBKK42jp3z3DCm; Thu, 27 Jul 2023 05:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690436232; 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=h5XjLMntviMtBWNrqcWy37QHaFRUzQ0bnGyQQxW7RjA=; b=o3VmHckKg9ZgZ817AIYV5fmuE6COMRbvd5FwjZ79p9SlIvPD1WFzfEsJyGvbiGvJMzheL1 UE1m9DnvDuVUkjUEtYTOBGSo474a1RQGMjvEAWosbOQamDXzxQGgruSFDge6CJ4oJsNC/g 8qfKOe6a1TwX8UOb+IcbdWLNcxLEkf1erTn+JuVK0wQ71q13IsnmDDmAXK8ByMWNRFqdqT d6sHZxCMpsC8srkLKw6r33cj5WseVTr8DDmubuyVodG/neAe/httHGcvtKOdHwm71lPKaN 43WwZowS4KHPV7jfMT7mw5YtxWPQCSS6x+SLKHT8P1TjVtXH39hWIr1iFF0G1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690436232; 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=h5XjLMntviMtBWNrqcWy37QHaFRUzQ0bnGyQQxW7RjA=; b=xu36oOSYfOEf13sphy+3mIcsToZmZPc5asQ/FqPtH2pxuUaV4d5MOCbf7GQEr+WCEcutL6 Tk5yM2i248q7JMSEDWaLDnDLw17RJdhxR/8AVUft6ciGzr4WkffcLrhX+KtC48GpsMsMDQ AlwquRbqq2r4dVPp0XuoqajpUNM2EOh1+E+A7eZZDeQrvmbyizVXqII8QZN031z9tKk05x /dW7uEQWbBZp14N3PuiLBlxL4EHiSiMZY+JqakZxu4iXR8RsVVHR5hnDcuDfEYcgDeio/N MT/BTC6M6MtiGQy5MVQxWtbNDp9ueN7DTnJ1eM9QPp0eCTPYMe6LHuLuJi1tWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690436232; a=rsa-sha256; cv=none; b=IsEERLtxwApXKZB8/LNYOOjCJ0b3+q106jVJNkXY6sAHpAc431UqgfIrW+sN7+mIdPbmgp Fb4vtofD6IHZnX9NyXIQWtdnUhrL4DP5iiiDlmpYlkzMAm+RN1aGi2IRBCYT9cAKVlSdPm lIBPyqkohp2GYgWqvqjbURP4+PDWpzLkvs6Lm8+80GqpWIOKZ3fHqcbp38j7K4jrMYYpyL /WBrW78NnDXrKdD+sKqyjo0KJ4lmw99sD5s3j9LHxQTiX7BGG1wx6sVA+Pu7xrNGPG3sZ0 cVy6dwsft0j4WJ2jrpML9XpSKU0s+EW2/K/kK7ViGWTIEOp1Z6fxN0dpe2L+vQ== 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 4RBKK41n8yz1ByN; Thu, 27 Jul 2023 05:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36R5bChx030055; Thu, 27 Jul 2023 05:37:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36R5bCC7030054; Thu, 27 Jul 2023 05:37:12 GMT (envelope-from git) Date: Thu, 27 Jul 2023 05:37:12 GMT Message-Id: <202307270537.36R5bCC7030054@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 74861578d955 - main - gve: Fix Tx tcpdump panic 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 74861578d95573e13a2099143f9d4e7edbb82806 Auto-Submitted: auto-generated The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=74861578d95573e13a2099143f9d4e7edbb82806 commit 74861578d95573e13a2099143f9d4e7edbb82806 Author: Shailend Chand AuthorDate: 2023-07-27 05:22:31 +0000 Commit: Xin LI CommitDate: 2023-07-27 05:36:42 +0000 gve: Fix Tx tcpdump panic Ringing the doorbell before making the BPF call can result in the mbuf being freed before the BPF call. Reviewed-by: markj MFC-after: 3 days Differential Revision: https://reviews.freebsd.org/D41189 --- sys/dev/gve/gve_tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/gve/gve_tx.c b/sys/dev/gve/gve_tx.c index dd48bc35a258..db3f7415f412 100644 --- a/sys/dev/gve/gve_tx.c +++ b/sys/dev/gve/gve_tx.c @@ -706,12 +706,12 @@ gve_xmit_br(struct gve_tx_ring *tx) break; } + drbr_advance(ifp, tx->br); + BPF_MTAP(ifp, mbuf); + bus_dmamap_sync(tx->desc_ring_mem.tag, tx->desc_ring_mem.map, BUS_DMASYNC_PREWRITE); gve_db_bar_write_4(priv, tx->com.db_offset, tx->req); - - drbr_advance(ifp, tx->br); - BPF_MTAP(ifp, mbuf); } }