From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5944C43458 for ; Wed, 8 Jul 2026 14:37:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A828C80D2B; Wed, 8 Jul 2026 14:37:03 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id jNit8KMRcZ99; Wed, 8 Jul 2026 14:37:01 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 722B381373 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1783521421; bh=exnNu2I5aI5H24F1WtiUJW2O63f75UQrbEQvXGcBk5s=; h=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EzU6EULYReSgxtZgRZt68EyoVXkgg/4Cs7w+PWyjMs95twuXmrGHkEebCbr55u8qA 9rqNItRyTGOxEUK0lvAWyD9SAKkjLxNTerS1rkq6lQVZ//vmWiPdOXQ4NJB/YxBu7f R/EqsWUf37ym/z99ciJMNKhH61MfhVM192+aIFzdGJYzlyWBgrSITkMNPWycDtS6sc b42zyLzu/bwB5LNoyGjaOZ+7G8YJ26sZRk/uVRlR+1fi4/Dao/gZh8VoiHJf5wpak7 HQ8G2kSYEGhQXZzk3DMQhNBkXAtANnNuBtazJ0AtdlvgqpjQ18eNEE//2F0zvnk1bc o3pRjfK5xX6Cg== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 722B381373; Wed, 8 Jul 2026 14:37:01 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists1.osuosl.org (Postfix) with ESMTP id D08DC315 for ; Wed, 8 Jul 2026 14:37:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B69FE40E6D for ; Wed, 8 Jul 2026 14:37:00 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id qli1iT2pvZ5h for ; Wed, 8 Jul 2026 14:36:59 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.4.254; helo=tor.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 9F74040E52 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9F74040E52 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by smtp4.osuosl.org (Postfix) with ESMTPS id 9F74040E52 for ; Wed, 8 Jul 2026 14:36:59 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id BE2C860008; Wed, 8 Jul 2026 14:36:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 072261F000E9; Wed, 8 Jul 2026 14:36:54 +0000 (UTC) From: Simon Horman To: mheib@redhat.com Cc: Simon Horman , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, corbet@lwn.net, anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch Date: Wed, 8 Jul 2026 15:36:51 +0100 Message-ID: <20260708143651.1491857-1-horms@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260701093830.948756-2-mheib@redhat.com> References: <20260701093830.948756-2-mheib@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783521417; bh=exnNu2I5aI5H24F1WtiUJW2O63f75UQrbEQvXGcBk5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bf0Y7f8LcK5njMeKKfJmq+s6ioYdgQLclm1vrgIVwKCC9dIAQv/DWPWNfgO/WLO6W CumTgWja4ZYeg2DRgEINH10R5BEwyG2Qal4dSILLMNpud5LoQWUfgE4BWpQ8o1xSiR fN4BPeU+dcpycQF3lCX+8o/Z1kJMATH5MdEAFzO866liybnj3pwTCewDNtoAFdl9Up CjntL4QoqsBvjeHhGjOW3NP0vyJ7sUZD7OY/MSJFb+XUz97jpQHqDZn/w2A82szYRR d90PaZhfzowdC3Ph4KHJrGpZyr8fWbnLCoviNrDL1MCRsVYdm7OyhMbpNj0jWHO7Pl eNvTxgDHXsF2w== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bf0Y7f8L Subject: Re: [Intel-wired-lan] [PATCH iwl-next v3 2/2] i40e: add devlink parameter for Flow Director ATR sample rate X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" This is an AI-generated review of your patch. The human sending this email has considered the AI review valid, or at least plausible. Full review at: https://sashiko.dev --- i40e: add devlink parameter for Flow Director ATR sample rate This commit introduces a runtime devlink parameter to tune the Flow Director ATR sample rate. This allows dynamic adjustments to the sampling interval without rebuilding the driver, which can help reduce TCP packet reordering on systems with high-rate workloads. > diff --git a/drivers/net/ethernet/intel/i40e/i40e_devlink.c b/drivers/net/ethernet/intel/i40e/i40e_devlink.c > index 229179ccc1319..cf487efdd803d 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_devlink.c > +++ b/drivers/net/ethernet/intel/i40e/i40e_devlink.c [ ... ] > @@ -33,12 +33,48 @@ 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; > + > + pf->atr_sample_rate = sample_rate; [Severity: Low] Does modifying pf->atr_sample_rate concurrently with the Tx fast path introduce a data race? In the Tx fast path, i40e_atr() reads this value locklessly. If the devlink callback sets this to 0 between the two reads in i40e_atr(): drivers/net/ethernet/intel/i40e/i40e_txrx.c:i40e_atr() { if (!pf->atr_sample_rate) return; ... if (tx_ring->atr_count < pf->atr_sample_rate) ... } Could this race lead to a situation where the second check evaluates tx_ring->atr_count against 0, unintentionally programming an extra Flow Director filter? While the functional impact might just be a single extra sampled packet, should we use READ_ONCE() in the fast path and WRITE_ONCE() here to avoid KCSAN data race warnings and ensure a consistent value is used throughout the function? > + return 0; > +} [ ... ]