Rs5aA4sFnv7fHtutWwBNCOQSIz+rQZXD7zxZ9o7qF7jHofNcSyFvxqZRJh0/O KMugNxAZclCxq2tz96yCisq5aMaz6Fe/LPn7/adxtsw9nTPqnotR45Qnk/CvlFsj6sXu5O ixzStd5ZdzZe+u0XQ958SkaXU8755f4ZnoxzTrFgxVHC9BHXaKLB5D/BgCVfMqaKC8qtiV siJvx7kFho0HTKpG53u1owuTd8yFccLpu+mt79Xm/rih6dkYZReHScyHArlU0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786350843; a=rsa-sha256; cv=none; b=ADBYCRN5rEWPrMBpKcRap9zpveXine6oslR5DghqDwgRGyJPLgHl0kty0R9Puoj1nMaAtz A8lsh/u/kfkOwml6aXHCNv/IpRx/jQ2KSTQWqadeRyVOFJ47YU4tTWodBXW0ZCIesjRZw9 dOldx/PTWr+/GNp9OVNtMMrPcbuijqGg85z1qxJcG/8rt2+dNxvUSsRsVHt5JKRq+Ax0h7 FC9+/WWzqaJlrzqJL2e42jBM2MbW1qpON+SXGwda3hVwwKZiMjeYqCBSXqmhe4AasaGIGY 38IyHRizCD5mzl2nAsLQWa86D206pn9qJBHOuKDH8A7ERLI90pK7gHVIkoevGQ== 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=1786350843; 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=Mqm106BCB3t8V50Lw8j2rpdN2kaobzRIlfmvK2qh9zE=; b=gO1YWyKXlFhG3icotxMNvv3tzTLxAyd+3fo5PHbRhoLZwTGVovc5YEXZXRoITtbBAVM/C8 vNepN39BUMj3wFp/ZHdW4lSpGOtiyBvliu4q41TcPL6izufyiHE3kMQRQxFZfoHxkIWfMd ovBlATn2anQf47jGvvBdnWWAYdbD6qUCwKu7CznxUHAoeVmpR+mDTnlUYNKQRppsYZ6yrp 9ehjq9qjJYNL/sERpjNYRwpZJ8XTaJgcNtHEYSDfahZvZpuUEdIflM+J8zOo0/cT0HT12t e9G7X8tX84rM58Bb8pAY+QEo16gLDSggQZgibX30z/0tSWIFXflhXCTDlzdJ/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hJShq3PZBz11rL for ; Mon, 10 Aug 2026 08:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 257b6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 10 Aug 2026 08:34:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 8eb4403e9d4a - main - iavf: Honor iflib transmit completion batching 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 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: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8eb4403e9d4a35f33a0ce41067ccb1924c6960dd Auto-Submitted: auto-generated Date: Mon, 10 Aug 2026 08:34:03 +0000 Message-Id: <6a798cfb.257b6.4eced87c@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=8eb4403e9d4a35f33a0ce41067ccb1924c6960dd commit 8eb4403e9d4a35f33a0ce41067ccb1924c6960dd Author: Kevin Bowling AuthorDate: 2026-08-10 07:31:56 +0000 Commit: Kevin Bowling CommitDate: 2026-08-10 08:32:56 +0000 iavf: Honor iflib transmit completion batching iavf uses descriptor writeback by default. Hardware writes completion status into a transmit descriptor only when it completes a descriptor marked RS. iavf marked every packet RS even though its report-status queue recorded and inspected only descriptors selected by iflib. The other completion writes could not help reclaim descriptors. iflib marks selected packets with IPI_TX_INTR as completion checkpoints. It forces a checkpoint as deferred work or ring pressure grows. Retain EOP on every packet, but set RS only at those checkpoints. The deprecated head-writeback option on 700-series VFs gets the same batching: each RS checkpoint permits hardware to publish the completed ring head. DPDK uses the same sparse RS design. Let iflib choose the adaptive interval for FreeBSD. This is a PCIe/memory bandwidth savings. MFC after: 2 weeks --- sys/dev/iavf/iavf_txrx_iflib.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/iavf/iavf_txrx_iflib.c b/sys/dev/iavf/iavf_txrx_iflib.c index 4707421748bc..991238b73e7a 100644 --- a/sys/dev/iavf/iavf_txrx_iflib.c +++ b/sys/dev/iavf/iavf_txrx_iflib.c @@ -304,8 +304,6 @@ iavf_tso_setup(struct tx_ring *txr, if_pkt_info_t pi) return ((idx + 1) & (scctx->isc_ntxd[0]-1)); } -#define IAVF_TXD_CMD (IAVF_TX_DESC_CMD_EOP | IAVF_TX_DESC_CMD_RS) - /** * iavf_isc_txd_encap - Encapsulate a Tx packet into descriptors * @arg: void pointer to the VSI structure @@ -327,7 +325,7 @@ iavf_isc_txd_encap(void *arg, if_pkt_info_t pi) bus_dma_segment_t *segs = pi->ipi_segs; struct iavf_tx_desc *txd = NULL; int i, j, mask, pidx_last; - u32 cmd, off, tx_intr; + u32 cmd, off, tx_intr, txd_cmd; if (__predict_false(pi->ipi_len < IAVF_MIN_FRAME)) { que->pkt_too_small++; @@ -338,6 +336,9 @@ iavf_isc_txd_encap(void *arg, if_pkt_info_t pi) i = pi->ipi_pidx; tx_intr = (pi->ipi_flags & IPI_TX_INTR); + txd_cmd = IAVF_TX_DESC_CMD_EOP; + if (tx_intr) + txd_cmd |= IAVF_TX_DESC_CMD_RS; /* Set up the TSO/CSUM offload */ if (pi->ipi_csum_flags & CSUM_OFFLOAD) { @@ -384,7 +385,7 @@ iavf_isc_txd_encap(void *arg, if_pkt_info_t pi) } /* Set the last descriptor for report */ txd->cmd_type_offset_bsz |= - htole64(((u64)IAVF_TXD_CMD << IAVF_TXD_QW1_CMD_SHIFT)); + htole64((u64)txd_cmd << IAVF_TXD_QW1_CMD_SHIFT); /* Add to report status array (if using TX interrupts) */ if (!vsi->enable_head_writeback && tx_intr) { txr->tx_rsq[txr->tx_rs_pidx] = pidx_last;