From nobody Wed Aug 19 21:04:01 2026 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 4hQJw21CWvz6pfZ2 for ; Wed, 19 Aug 2026 21:04:02 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hQJw15nt4z3lp1 for ; Wed, 19 Aug 2026 21:04:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787173441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fmBeSTM9WhbVXsLDf2Pzu4d3ddRvd7OBDsRpwIp6I3I=; b=I1kwSncMmeygPK+/uHpZ/TZCt3uJuUOGI443Uz4H36/71z7ZNnLEMBBl7MP7mmLsfzSRZA 4xkrE9fpbYJaSHvXz5pgczvRh5Lg1IhTrz2mUzN4zouJZm/pBTV5BlWKVDAM1hSfuVRUC0 P090s6r1BEiCmXKZPWY7dyLaYZpEm6PqyF9tro7HF2coW9d9luaZtwXhwVQSChS55CEINe e+orhXxfdD+4fHjD5179Ar7/4Rh2+lmb4YbvT75UJENZxgcGRBI1hCB5nSU+Tj4cZUoBaK 6Uv0yYApGHMI8yLDVIBGT/G/jZmecX8ZX7VPO3ZtMADJJAOj9dwqPPwAb8nMAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787173441; a=rsa-sha256; cv=none; b=wKXTlhpzXCjLlHm1EgTyh8oyQ81F23enq1Zu2oalBrdxB8tKty5uMgiuQquCie2kh1o78Y 9pmTZUs2qvZGqLt9ISdzC963GDWPe0ooGzplUj0+XRzN8DqYGqIDQJUXN9JjDdTgORUjYd mlskueAnT2WRI4O7I7vfTnGFEUpaBl/Xp5WGZYgBPMthL1WkcYYlekwoOHSVVT2QEUZy4j 0zMGnPK5g7bTzsQGsGhRwW8hA4a42XYRqBwc0ybVYXY3WPAUjqQ88tKCjneKvcHNVNVPIs o3h0hHclsgkItBBHTrgN32ZF1Hul2UZs3Fu09/xlhPs3QEPVTOUp44u5ewVN0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787173441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fmBeSTM9WhbVXsLDf2Pzu4d3ddRvd7OBDsRpwIp6I3I=; b=e12W/0jX0N/OhivUe4g5i/PdZbQIPbqDS9GETzdqw4JskTMWkRDcIjWrx3PoWJ4llhm1T7 Tx9NOgEQTCAEwApgSPtHlcPcY7PzVsLnI3IXvuFiL9GPOykG/NHq43gGTqS7usbkOibyM0 V+RDljT2AFpdvRFMGRl6mmeFMeae5qgj8KWYfM4vp686lWoje9Ss+1eH0Rv5HFfjeAdW18 XNYYmJQohqY1Vi1JWy1sW/3DJCBTM/L2y+CO7ywMwt9fPGEXX/IVVdZ+KZ+q7pi9uYfCxQ d78amh+Pe7IAiYuunjHmSCA7nO3LNapyC23IFpRT/BnH39Sze+2wx53rrBIcGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hQJw14rr7znqq for ; Wed, 19 Aug 2026 21:04:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31756 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 19 Aug 2026 21:04:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Sujithra Periasamy From: Mark Johnston Subject: git: f30ef139274b - stable/14 - gve: Implement AQ batching for queue creation and destruction 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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/stable/14 X-Git-Reftype: branch X-Git-Commit: f30ef139274b54a39eb219f47c7a91b17a1accec Auto-Submitted: auto-generated Date: Wed, 19 Aug 2026 21:04:01 +0000 Message-Id: <6a861a41.31756.28e0c5d8@gitrepo.freebsd.org> The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f30ef139274b54a39eb219f47c7a91b17a1accec commit f30ef139274b54a39eb219f47c7a91b17a1accec Author: Sujithra Periasamy AuthorDate: 2026-08-07 13:07:20 +0000 Commit: Mark Johnston CommitDate: 2026-08-19 18:08:59 +0000 gve: Implement AQ batching for queue creation and destruction Currently, the FreeBSD driver configures and destroys queues sequentially by issuing individual Admin Queue (AQ) commands. During queue teardown (e.g., interface reset), disabling queues one by one leaves the device in a partially configured state. Because the device does not yet know that the driver is in the process of fully unconfiguring all queues, this intermediate state can trigger transient error logs (such as when queue 0 is disabled while other queues are still active). Modify the driver to use Admin Queue batching for both the creation and destruction of TX and RX queues. Commands are now queued and kicked together, ensuring the queue configuration changes are applied atomically and preventing transient errors from being logged. Signed-off-by: Sujithra Periasamy Reviewed by: markj MFC after: 1 week Sponsored by: Google Differential Revision: https://reviews.freebsd.org/D58696 (cherry picked from commit 36d57489ca07642dec31390e90c25b2a0ca9313e) --- sys/dev/gve/gve_adminq.c | 47 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/sys/dev/gve/gve_adminq.c b/sys/dev/gve/gve_adminq.c index 9b59570a2af4..43952308098b 100644 --- a/sys/dev/gve/gve_adminq.c +++ b/sys/dev/gve/gve_adminq.c @@ -214,6 +214,9 @@ gve_process_device_options(struct gve_priv *priv, return (0); } +static int gve_adminq_issue_cmd(struct gve_priv *priv, + struct gve_adminq_command *cmd); +static int gve_adminq_kick_and_wait(struct gve_priv *priv); static int gve_adminq_execute_cmd(struct gve_priv *priv, struct gve_adminq_command *cmd); @@ -225,7 +228,7 @@ gve_adminq_destroy_tx_queue(struct gve_priv *priv, uint32_t id) cmd.opcode = htobe32(GVE_ADMINQ_DESTROY_TX_QUEUE); cmd.destroy_tx_queue.queue_id = htobe32(id); - return (gve_adminq_execute_cmd(priv, &cmd)); + return (gve_adminq_issue_cmd(priv, &cmd)); } static int @@ -236,7 +239,7 @@ gve_adminq_destroy_rx_queue(struct gve_priv *priv, uint32_t id) cmd.opcode = htobe32(GVE_ADMINQ_DESTROY_RX_QUEUE); cmd.destroy_rx_queue.queue_id = htobe32(id); - return (gve_adminq_execute_cmd(priv, &cmd)); + return (gve_adminq_issue_cmd(priv, &cmd)); } int @@ -248,13 +251,18 @@ gve_adminq_destroy_rx_queues(struct gve_priv *priv, uint32_t num_queues) for (i = 0; i < num_queues; i++) { err = gve_adminq_destroy_rx_queue(priv, i); if (err != 0) { - device_printf(priv->dev, "Failed to destroy rxq %d, err: %d\n", + device_printf(priv->dev, "Failed to issue destroy rxq %d, err: %d\n", i, err); + return (err); } } - if (err != 0) + err = gve_adminq_kick_and_wait(priv); + if (err != 0) { + device_printf(priv->dev, "Failed to batch destroy rx queues, err: %d\n", + err); return (err); + } device_printf(priv->dev, "Destroyed %d rx queues\n", num_queues); return (0); @@ -269,13 +277,18 @@ gve_adminq_destroy_tx_queues(struct gve_priv *priv, uint32_t num_queues) for (i = 0; i < num_queues; i++) { err = gve_adminq_destroy_tx_queue(priv, i); if (err != 0) { - device_printf(priv->dev, "Failed to destroy txq %d, err: %d\n", + device_printf(priv->dev, "Failed to issue destroy txq %d, err: %d\n", i, err); + return (err); } } - if (err != 0) + err = gve_adminq_kick_and_wait(priv); + if (err != 0) { + device_printf(priv->dev, "Failed to batch destroy tx queues, err: %d\n", + err); return (err); + } device_printf(priv->dev, "Destroyed %d tx queues\n", num_queues); return (0); @@ -325,7 +338,7 @@ gve_adminq_create_rx_queue(struct gve_priv *priv, uint32_t queue_index) htobe16(priv->rx_buf_size_dqo); } - return (gve_adminq_execute_cmd(priv, &cmd)); + return (gve_adminq_issue_cmd(priv, &cmd)); } int @@ -337,12 +350,19 @@ gve_adminq_create_rx_queues(struct gve_priv *priv, uint32_t num_queues) for (i = 0; i < num_queues; i++) { err = gve_adminq_create_rx_queue(priv, i); if (err != 0) { - device_printf(priv->dev, "Failed to create rxq %d, err: %d\n", + device_printf(priv->dev, "Failed to issue create rxq %d, err: %d\n", i, err); goto abort; } } + err = gve_adminq_kick_and_wait(priv); + if (err != 0) { + device_printf(priv->dev, "Failed to batch create rx queues, err: %d\n", + err); + goto abort; + } + if (bootverbose) device_printf(priv->dev, "Created %d rx queues\n", num_queues); return (0); @@ -381,7 +401,7 @@ gve_adminq_create_tx_queue(struct gve_priv *priv, uint32_t queue_index) cmd.create_tx_queue.tx_comp_ring_size = htobe16(priv->tx_desc_cnt); } - return (gve_adminq_execute_cmd(priv, &cmd)); + return (gve_adminq_issue_cmd(priv, &cmd)); } int @@ -393,12 +413,19 @@ gve_adminq_create_tx_queues(struct gve_priv *priv, uint32_t num_queues) for (i = 0; i < num_queues; i++) { err = gve_adminq_create_tx_queue(priv, i); if (err != 0) { - device_printf(priv->dev, "Failed to create txq %d, err: %d\n", + device_printf(priv->dev, "Failed to issue create txq %d, err: %d\n", i, err); goto abort; } } + err = gve_adminq_kick_and_wait(priv); + if (err != 0) { + device_printf(priv->dev, "Failed to batch create tx queues, err: %d\n", + err); + goto abort; + } + if (bootverbose) device_printf(priv->dev, "Created %d tx queues\n", num_queues); return (0);