Article View: linux.kernel.netdev
Article #27143[PATCH net-next v2 2/2] i40e: add devlink parameter for Flow Director ATR sample rate
From: Tony Nguyen
Date: Fri, 04 Dec 2026 21:38
Date: Fri, 04 Dec 2026 21:38
128 lines
13533 bytes
13533 bytes
From: Mohammad Heib <mheib@redhat.com>
The i40e driver uses Flow Director ATR to periodically update flow
steering information for active TCP flows. The update frequency is
currently controlled by I40E_DEFAULT_ATR_SAMPLE_RATE and is fixed at
driver build time.
On systems with a large number of queues and high-rate TCP workloads,
the default sampling interval can result in frequent Flow Director
reprogramming for long-lived flows.
The amount of TCP packet reordering observed on some systems is
sensitive to the ATR sampling interval. Increasing the interval reduces
Flow Director programming activity and can significantly reduce the
associated reordering.
Since the optimal sampling interval depends on the workload and system
configuration, a single fixed value is not suitable for all deployments.
Add a devlink parameter to allow administrators to tune the ATR sample
rate at runtime without rebuilding the driver or disabling ATR
functionality entirely.
Signed-off-by: Mohammad Heib <mheib@redhat.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
Documentation/networking/devlink/i40e.rst | 21 +++++++++
.../net/ethernet/intel/i40e/i40e_devlink.c | 46 +++++++++++++++++++
2 files changed, 67 insertions(+)
diff --git a/Documentation/networking/devlink/i40e.rst b/Documentation/networking/devlink/i40e.rst
index 51c887f0dc83..d280c17fe987 100644
--- a/Documentation/networking/devlink/i40e.rst
+++ b/Documentation/networking/devlink/i40e.rst
@@ -40,6 +40,27 @@ Parameters
The default value is ``0`` (internal calculation is used).
+.. list-table:: Driver specific parameters implemented
+ :widths: 5 5 90
+
+ * - Name
+ - Mode
+ - Notes
+ * - ``atr_sample_rate``
+ - runtime
+ - Controls how frequently Flow Director ATR updates flow steering
+ information for active TCP flows.
+
+ ATR programs Flow Director entries based on sampled TCP packets
+ per Tx queue. The sampling interval is the number of TCP packets
+ transmitted on each queue between ATR updates.
+
+ Lower values increase Flow Director programming activity, while
+ higher values reduce the update frequency.
+
+ Setting to ``0`` disables ATR sampling (no filters will be programmed).
+
+ The default value is ``20``.
Info versions
=============
diff --git a/drivers/net/ethernet/intel/i40e/i40e_devlink.c b/drivers/net/ethernet/intel/i40e/i40e_devlink.c
index 229179ccc131..8af2487776f2 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_devlink.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_devlink.c
@@ -33,12 +33,58 @@ static int i40e_max_mac_per_vf_get(struct devlink *devlink,
return 0;
}
+static int i40e_atr_sample_rate_set(struct devlink *devlink,
+ u32 id,
+ struct devlink_param_gset_ctx *ctx,
+ struct netlink_ext_ack *extack)
+{
+ struct i40e_pf *pf = devlink_priv(devlink);
+ u32 sample_rate = ctx->val.vu32;
+
+ WRITE_ONCE(pf->atr_sample_rate, sample_rate);
+
+ /* Setting rate to 0 disables sampling but does not remove
+ * existing ATR entries. Flush them so stale filters do not
+ * persist on devices without HW ATR eviction.
+ */
+ if (!sample_rate) {
+ set_bit(__I40E_FD_ATR_AUTO_DISABLED, pf->state);
+ set_bit(__I40E_FD_FLUSH_REQUESTED, pf->state);
+ }
+
+ return 0;
+}
+
+static int i40e_atr_sample_rate_get(struct devlink *devlink,
+ u32 id,
+ struct devlink_param_gset_ctx *ctx,
+ struct netlink_ext_ack *extack)
+{
+ struct i40e_pf *pf = devlink_priv(devlink);
+
+ ctx->val.vu32 = READ_ONCE(pf->atr_sample_rate);
+
+ return 0;
+}
+
+enum i40e_dl_param_id {
+ I40E_DEVLINK_PARAM_ID_BASE = DEVLINK_PARAM_GENERIC_ID_MAX,
+ I40E_DEVLINK_PARAM_ID_ATR_SAMPLE_RATE,
+};
+
static const struct devlink_param i40e_dl_params[] = {
DEVLINK_PARAM_GENERIC(MAX_MAC_PER_VF,
BIT(DEVLINK_PARAM_CMODE_RUNTIME),
i40e_max_mac_per_vf_get,
i40e_max_mac_per_vf_set,
NULL),
+ DEVLINK_PARAM_DRIVER(I40E_DEVLINK_PARAM_ID_ATR_SAMPLE_RATE,
+ "atr_sample_rate",
+ DEVLINK_PARAM_TYPE_U32,
+ BIT(DEVLINK_PARAM_CMODE_RUNTIME),
+ i40e_atr_sample_rate_get,
+ i40e_atr_sample_rate_set,
+ NULL),
};
static void i40e_info_get_dsn(struct i40e_pf *pf, char *buf, size_t len)
--
2.47.1
Technical Details
Message-ID:
<20261204213811.3397760-3-anthony.l.nguyen@intel.com>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377647-linux-kernel-netdev=dewy.ruReferences:
<20261204213811.3397760-1-anthony.l.nguyen@intel.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377647-linux-kernel-netdev=dewy.ru From: anthony.l.nguyen@intel.com (Tony Nguyen) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v2 2/2] i40e: add devlink parameter for Flow Director ATR sample rate Date: Fri, 4 Dec 2026 13:38:10 -0800 Organization: Usenet Network Message-ID: <20261204213811.3397760-3-anthony.l.nguyen@intel.com> References: <20261204213811.3397760-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2875847"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ovDx/vgIYqXQvlaHiGyN4Fny7LA= sha256:yJo9WwjWmV0sc3yB43fSo7kL8kcLSztIFA26VfUDyu0= sha1:b7bKfL/yGoawgmB8Qvz7TH7cnxE= sha256:wIPP8OdwIEw3MxH8+gqybKA9BN3Lzg6dEzc7NhhGBE0= 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 C7CEC117CEC; Sat, 5 Dec 2026 00:38:39 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.441 X-Spam-Status: No, score=-3.441 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.142, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=intel.com 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 c3VExoZ7KLJP; Sat, 5 Dec 2026 00:38:37 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377647-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=intel.com X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id E1986117CED; Sat, 5 Dec 2026 00:38:27 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 42D842DAE6; Fri, 4 Dec 2026 21:38:21 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796420300; b=Tbv9mXrXSorUEd9bHNtHfGRf5Msfm2JvG9TE5/UU8KqNyuXiO7hYzRTjgLO9qSZasM0e BzlC2ka931mZtZ0DpfGYyhClINGwAwQDzWIJ3v1axr/r2NqLDmFepNrNkpVGGKmu1JWLM BMOTT4NJHyVganuZcDsb9pCEQLR7gk7hnvl0Yc0pTGuo9y0W7zFMVhq1XjIdS9UWKs/7k psNi1ldRhfWzcI5/2oMFr5fmRYP5STYXms8aEIgYg8Kl5Q9FpgTYn0hbtz7033Q2dMe7T qelTyHNQuJTnglgs1kBY75S94hVE+TEGJJslcQuS78o1t0qWGtISCThNPjG6x+lLJaA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796420300; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature: X-CSE-ConnectionGUID:X-CSE-MsgGUID:X-IronPort-AV:X-IronPort-AV: Received:X-CSE-ConnectionGUID:X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=2v6FKy96HKCJBQUnSmQU4Wk5Ba4fIofCO08M+V/YEDU=; b=h7G9bOVWHe2wGAGYwnH0ksHjuy/eZWoP99YK4jBtT7qyXw0QSqm6VI3Wt5JyEnne+HGN JaQ96rB5dw+lilTQeRHRa6H09qqFG6jpXwh4iLiNkExdv+7dHDg+PejWkBhboJ9jg2/Tn yBWjlYzTTDl9VN8dmKRRek5Kd4OkDbDYVjAm6sc4lLvSxCxOXbyC5H24KNs2BzO2XuheL 9YsQCqARRFl2cs2XMqnc89ILQ1VDkZ5UsORjwjG+RbB68Ld8A+CbhYPgxCHcsJltFFpy7 KeEHZa0o6NQxjZ2JVsex1tML3s9A2WPiEUZQuy0ArLirj1zeP1KhFj4hjN6IqGzGPsg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=SqT2wD8N; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 002E7606A68B; Fri, 4 Dec 2026 21:38:20 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=SqT2wD8N X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.12 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796420299; b=BdPes0Lj9jkrdJfAHN/ORZpkdqkra4Kn6K0L4zZvrQWDMAab+zCeWMnYEyPjKpQfeZVt ZWuJ0VoUo2QEp+1Nk9xkaw2JmXFk0B42vNTK6effFQWP0JL/14TZpZaWNorTLxkXqFN0v m0TAtg5rShohIpbA0F9nFxSRQK/JvqI1Xxr4Y/NQRgPbb0SnA8VWjQVqCtZwhC7SYiIDO iBio6pYKtRQ53hmYBL89LpxkkGXMCAIvjRFXMq4qz4OEuSIK5eUJJbnHKlpD3f0Tq/8RX d7H6aNFEqCC2QciGKAdC1NgXCxU/2sPcX/I99I7N7uZhTRBov9RrQ84tjgXiEtsUV9A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796420299; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=2v6FKy96HKCJBQUnSmQU4Wk5Ba4fIofCO08M+V/YEDU=; b=g9pSlkoPOtU4XSlqwz3AVVE2MQ6RNXnJmRg6zkhfgSNEqRiIpGHc96uOhWdvE9j8HfKT 9O8H0hKwJcMgZSmqpGhlEbwb4h9pRLGBFN6TRV7lIdTL3HD69gEmstXUqPBUe7lxNFbey t+aDwTbz21l0zKZWVd/QMiqVB8TSasDXLZwmWalWCE+85WUGSHOAMIhPJHIaVoySw1S8U u6VeurGigwlbKieR46JfMMckVQOg/S24JmcPXsMfTj1Hgm5ZkeuuG27ggz47ojIsK79sh 9lKq1iDLx6hkil/qextXl24ExVIvWVLi6ljCQN+LhKe3sA02YeK+gGqpvqxUGpxjPSQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=SqT2wD8N; arc=none smtp.remote-ip=198.175.65.12 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF644606A333; Fri, 4 Dec 2026 21:38:18 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BF644606A333 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796420299; x=1827956299; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2v6FKy96HKCJBQUnSmQU4Wk5Ba4fIofCO08M+V/YEDU=; b=SqT2wD8N+NVRYGUiTqYzQE4Ro8bPrNbxkBVi4KW4r6YZfUdwesMtytvY 6qDgST8JjehNCZcaD8At3HnTzCX5eHIQGMcYF5S29xyxb3u+qlCsZ/lpX 6QN5RiSyjhwHf9jnKRcriDnGMhcXRea4eiiEq16bPF7gzfOtg822V1rkv l3ZHnkfGjmrWQDcNkaw844UAEfFk5cMWWNQ5P2gKpbAuXh/oR/fS30Y9E Q4WWLFm5ACm6rdsN2Wz/foo1GBR8oIpGOZR370BIBp2dbKljsc7ubzr6M wrmm/BvIqHCsHfT4bdVvuXuMnLlzZmGriguHZ2L32GlYDXhjBbprm2dRx Q==; X-CSE-ConnectionGUID: 9e5GHvwZTtOq6AJDP+2GDg== X-CSE-MsgGUID: /0ZoayBnQzGQmNBADUrDBA== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5335873" X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="5335873" X-Received: from fmviesa012.fm.intel.com ([10.60.135.152]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 13:38:17 -0800 X-CSE-ConnectionGUID: waSVeC1BQsWYTc3RFWWyvg== X-CSE-MsgGUID: nxZIZqDVSdeu7YhOAfH4XA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="15823266" X-Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by fmviesa012.fm.intel.com with ESMTP; 04 Dec 2026 13:38:16 -0800 X-Cc: Mohammad Heib <mheib@redhat.com>, anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, jiri@resnulli.us, horms@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, linux-doc@vger.kernel.org X-Mailer: git-send-email 2.47.1 X-In-Reply-To: <20261204213811.3397760-1-anthony.l.nguyen@intel.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list