🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #4584

Re: [PATCH v3 net-next 14/15] selftests: drv-net: test AF_XDP zero-copy with an SKB peer

#4584
From: Björn Töpel
Date: Sun, 18 Oct 2026 15:51
62 lines
7769 bytes
Maciej Fijalkowski <maciej.fijalkowski@intel.com> writes:

>> [Severity: Medium]
>> On NICs that steer flows based on TX, is taking the queue out of RSS
>> enough to keep the TCP control connection off it?
>> 
>> Flow Director ATR is on by default on i40e. i40e_atr() samples TCP TX
>> packets, including the SYN. It then programs an FD filter that steers the
>> flow's RX to the queue of the TX ring:
>> 
>> drivers/net/ethernet/intel/i40e/i40e_txrx.c:i40e_atr() {
>>     ...
>> 	flex_ptype = FIELD_PREP(I40E_TXD_FLTR_QW0_QINDEX_MASK,
>> 				tx_ring->queue_index);
>>     ...
>> }
>
> SO CLOSE! This one has to be addressed as atr is turned on by default and
> this could cause i40e runs being stochastic. I must admit I did not have
> i40e setup on my side, but it has full AF_XDP feature support (including
> mbuf zc) so its coverage matters.
>
> Fix would be:
>
> diff --git a/tools/testing/selftests/drivers/net/hw/xsk.py b/tools/testing/selftests/drivers/net/hw/xsk.py
> --- a/tools/testing/selftests/drivers/net/hw/xsk.py
> +++ b/tools/testing/selftests/drivers/net/hw/xsk.py
> @@ -115,6 +115,16 @@ def _reserve_queue(cfg, undo):
>      return queue
>  
>  
> +def _disable_atr(cfg, undo):
> +    """i40e ATR steers what a TCP connection receives to the queue that it
> +    sends from, which can be the zero-copy one, so turn it off until undo."""
> +    flags = cmd(f"ethtool --show-priv-flags {cfg.ifname}", fail=False).stdout
> +    if re.search(r"^flow-director-atr\s*: on$", flags, re.MULTILINE):
> +        priv = f"--set-priv-flags {cfg.ifname} flow-director-atr"
> +        ethtool(f"{priv} off")
> +        undo.callback(ethtool, f"{priv} on")
> +
> +
>  def _steer_udp(cfg, undo, ifname, queue, host=None):
>      """Steer the test flow to queue until undo, return False if ifname
>      cannot."""
> @@ -313,6 +323,7 @@ def main():
>          cfg.queue = _reserve_queue(cfg, undo)
>          if cfg.queue is None:
>              sys.exit(SKIP_CODE)
> +        _disable_atr(cfg, undo)
>  
>          cfg.udp_port = rand_port()
>          steered = (_steer_udp(cfg, undo, cfg.ifname, cfg.queue) and

Sneaky ATR. Is i40e run in the HW selftests? Could this be a follow-up?


Björn
Technical Details
Message-ID: <87wlrf2eiq.fsf@all.your.base.are.belong.to.us>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348079-linux-kernel-netdev=dewy.ru
References: <20261014184539.774708-15-maciej.fijalkowski@intel.com> <179220637173.434549.12610717858136223745@kernel.org> <atPDf2DpOfWLt9cT@boxer>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348079-linux-kernel-netdev=dewy.ru
From: bjorn@kernel.org (Björn Töpel)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v3 net-next 14/15] selftests: drv-net: test AF_XDP
 zero-copy with an SKB peer
Date: Sun, 18 Oct 2026 17:51:25 +0200
Organization: Usenet Network
Message-ID: <87wlrf2eiq.fsf@all.your.base.are.belong.to.us>
References: <20261014184539.774708-15-maciej.fijalkowski@intel.com>
 <179220637173.434549.12610717858136223745@kernel.org>
 <atPDf2DpOfWLt9cT@boxer>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="3362482"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:xED8dLmujrtYFf2AnSbLD7KPCLI= sha256:k+LkAcT1tA2OlEv1mihtTpx5j4qWKjrW+ngIZiHHt+Q=
	sha1:ukHbrUlcFCNz3Hv8Po2jKwopApY= sha256:6LxBpkrLM7Zdej2OeRuM/62t2pTguTfM0ptnbXlZm+0=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 40B4E110839; Sun, 18 Oct 2026 18:52:07 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.739
X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.34, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id P0m2G3odvh7k;
	Sun, 18 Oct 2026 18:52:04 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-348079-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 7F5A9110804; Sun, 18 Oct 2026 18:51:54 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 35EA53295F; Sun, 18 Oct 2026 15:51:34 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D3843AFD1D;
	Sun, 18 Oct 2026 15:51:32 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="n5lIATDr"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 828BC3AFB0C;
	Sun, 18 Oct 2026 15:51:29 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792338692; cv=none; b=SJTCpwd0XzAwMS2sYTk5VuP2MI4rW7lc6YjT9GLVciXNeJtV0Wj37wkOIud6NUBpnmOwwGsec/PA7euThJWkR0IdJML9rmUMtqCuNZiNp+lBo1dVuObO+JcOvpa6NVA2p7lwpRJK8Ybuvg1IZN5WBOeW4nxCoNkAi/psblGxG+g=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792338692; c=relaxed/simple;
	bh=YaTa1/1PdHeY1cjXBLQYg/PF4Y+5ID+lV3t24mYibm4=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 MIME-Version:Content-Type; b=dllLxgcj9Qi/BgKmChsETonDuKoGT3tdEyuFujCMXKtd0ozpZR2gwrzCANZA66NBcxx2wuamb6t1Ca+UfMXxBTL+NB7Hu/akQ+kidwTjgRUHdmTg8hmkgNAxoQ8Hd4mRj3lK+LRVUFl84ryTj+jARLCIl+HMPM2tC6zJcOaiijA=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=n5lIATDr; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 687CE1F000C5;
	Sun, 18 Oct 2026 15:51:28 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792338688;
	bh=OCyuWrGMdsrJgJ7HP4P3X9ZkHaLlXw6IVzKc+k+MNYk=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date;
	b=n5lIATDrVO1XaYWfTrfOs5WFKjDjfV6ACJBJLNV/B8wt6EN88GlNS9igrXos3//eH
	 ytrF+mpst34HxwUecxZnMvD8RjQ6dRwZtjczaU26/7Z4Ly2gIvA0G++/4z9Xi0LRF/
	 E0nMWfD7REyFgfdQfWlIgfDG9Qm+9VV+YoskbPfr4ZTOYF51lnT91aQ80d3+ueAlIu
	 ToM7QsffDrZRnFVSDsVrGglhMO35A5nE4hAZe8EmIllhGKj1BUWThYJPmC5NQkOY8L
	 S00aR1hAu/Abzmp/1r1VR7exgHzDtQlYrt4KQyLDqYulWVvezYOxaUoEjgJPpjewh7
	 E3M9RT4IhRxyw==
X-Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, magnus.karlsson@intel.com,
 stfomichev@gmail.com, kuba@kernel.org, pabeni@redhat.com,
 tushar.vyavahare@intel.com, kerneljasonxing@gmail.com
X-In-Reply-To: <atPDf2DpOfWLt9cT@boxer>
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>