From nobody Thu Apr 2 22:44:03 2026 X-Original-To: dev-commits-src-branches@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 4fmxjb5Fsnz6YvHB for ; Thu, 02 Apr 2026 22:44:03 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fmxjb3FNpz44hj for ; Thu, 02 Apr 2026 22:44:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775169843; 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=P24197/PZOvxaneayknjB18CRnu/Zvx9WRDsCWyHIFI=; b=GQu2Ogf2g6F9DK+1sMPT+Huia1WWfyBOWTpPoptsOC4BJdatQa3opLw9MqjAzSKL69rfm7 4ee3ZG63QUXjEqDNzXw5bSS2UT4r6NRpGqBO7iFPs1DmlUqX9xs2PukhscGQvfFdTs75Sx 3HDwRmJ39f7yjWpApZZ6oYXjDrRaMhn7GdpgnqQs0cNfeuKvuhtwNZRg/FjYF8u9OUgHrl TXihrUCk4J01hKW+ZZ28E2MGurmvhKoetmIShykfHxeXOFEv0gk4F53JFnBxQ4KjxGwlUi RqUXsGRggWzzem6cJ4JD5e0UC8d8MBJWmq8eIE0fJ88SQx7xX+wIaUqrI1eiYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1775169843; a=rsa-sha256; cv=none; b=CVKQlJk/P17MPg0lt2IGK2n93qmjkSQZYZQdDzBMUAyuLHhrvbJRq7zN8V/2AUqh8R85b5 42U0kTELnzyH5zMe3fBMOCHGCwliuODznsBbPRtjSbuz71vK77rec1Naw6LuP2l5foA6GU P/vZ5W1P70mp5CJxv3pHwV0ExXRElA/r9x6//G2wQKEG/0quvF60+B6kHxqHJzairQr0rI kt31U39NigyvFv6zq5hXq3BdSTwg72MRG7cCHn5c2jupFws4HdT69g2kv4hxrOOj9bHqoX yabYtYQlldYcdu5FWgxzq0gbsFoYMSWjxfZlwdI3ssPW5SRJnTBIh++AIQa0kQ== 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=1775169843; 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=P24197/PZOvxaneayknjB18CRnu/Zvx9WRDsCWyHIFI=; b=DNwJabe03lPHUfHZeL8sKktdNj6vYOziYNoUZ3CeAfL49e2CJypSbKC0zkMm7RIWGeNHvD 6V76tyazUCKA5OpkcWbyaErSskiBvTe7+bd16PAGhx8U3dmaLEgqSkLneb/6LVxmjpx1/r otM4zyGGDeBrLQl+x5d6tZ4/tPhARhRICfqtcETr0EM2+S2HdgLRJyaMy5+kswJqCuExd2 EZja0YOK4a88AfPHLkAgU1uYJAV/QKaR5PsQzGEjSll3GgkuY+cGsyqK441zuWHLxUPaJE Yn/n03ikSg4G2UFOy+t71Gt2rJ8B3RsAzShv+cd9/H3Yhj2n1xl/RvMxOV+2ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fmxjb2bhCz6TS for ; Thu, 02 Apr 2026 22:44:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45c30 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 02 Apr 2026 22:44:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Arthur Kiyanovski From: Arthur Kiyanovski Subject: git: b345e18a7b67 - stable/14 - ena: Verify that an ENA ring is in netmap only in native mode List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b345e18a7b67ac7441c9305ed4193fabb9217c68 Auto-Submitted: auto-generated Date: Thu, 02 Apr 2026 22:44:03 +0000 Message-Id: <69cef133.45c30.706f0aea@gitrepo.freebsd.org> The branch stable/14 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=b345e18a7b67ac7441c9305ed4193fabb9217c68 commit b345e18a7b67ac7441c9305ed4193fabb9217c68 Author: Arthur Kiyanovski AuthorDate: 2026-02-14 01:13:00 +0000 Commit: Arthur Kiyanovski CommitDate: 2026-04-02 22:39:50 +0000 ena: Verify that an ENA ring is in netmap only in native mode netmap operates in two modes: 1) Emulated - netmap handling is done by the network stack, the NIC driver operates transparently to netmap. 2) Native - netmap management is done by the NIC driver. When checking whether a specific ENA ring is running in netmap mode, only the following checks were done: 1. IFCAP_NETMAP - Check whether netmap capability is enabled on the device. 2. NKR_NETMAP_ON - Check whether netmap is actively using this ring. The above checks implied that the netmap mode is native and the ENA driver needs to handle the netmap logic. The code was missing an explicit check on whether native mode is actually on (NAF_NATIVE). This led to a case where though emulated mode was used and a netmap application was turned on, the ENA driver still managed netmap logic partially and caused missing buffers and lack of refill as part of the datapath. Note: Enabling netmap emulated mode is insufficient and there's a need to load a netmap program in order to trigger this use-case. Add an explicit check of whether NAF_NATIVE mode is set. The issue was reported in [1]. [1]: https://github.com/amzn/amzn-drivers/issues/361 Fixes: 358bcc4c6cde ("Add support for ENA NETMAP partial initialization") Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D55697 Sponsored by: Amazon, Inc. (cherry picked from commit 97e84c587d6f86aa883720296449b380adcf6915) --- sys/dev/ena/ena_netmap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index 8a220373ec3f..0e8c95fb289a 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -223,9 +223,11 @@ ena_ring_in_netmap(struct ena_adapter *adapter, int qid, enum txrx x) if (if_getcapenable(adapter->ifp) & IFCAP_NETMAP) { na = NA(adapter->ifp); - kring = (x == NR_RX) ? na->rx_rings[qid] : na->tx_rings[qid]; - if (kring->nr_mode == NKR_NETMAP_ON) - return true; + if (na->na_flags & NAF_NATIVE) { + kring = (x == NR_RX) ? na->rx_rings[qid] : na->tx_rings[qid]; + if (kring->nr_mode == NKR_NETMAP_ON) + return true; + } } return false; }