Article View: linux.kernel.netdev
Article #8222Re: [PATCH net v3] bonding: fix initial last_rx vs ARP-monitor slack window
From: netdev-bot+sashiko
Date: Wed, 28 Oct 2026 12:25
Date: Wed, 28 Oct 2026 12:25
106 lines
12090 bytes
12090 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The patch ages last_tx along with last_rx (new_slave->last_tx
= new_slave->last_rx), so last_tx is now two intervals old instead of…
--
bonding: fix initial last_rx vs ARP-monitor slack window
This commit moves the initial last_rx seed in bond_enslave() from one
arp_interval in the past to two. The goal is to keep the seed outside the
arp_interval/2 slack window that commit da210f559019 added. The
per-target array and last_tx get the same seed, because they are copied
from last_rx.
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 7019e5d8fdc8e..269384fadfa6f 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -2123,7 +2123,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
> new_slave->link = BOND_LINK_DOWN;
>
> new_slave->last_rx = jiffies -
> - (msecs_to_jiffies(bond->params.arp_interval) + 1);
> + (2 * msecs_to_jiffies(bond->params.arp_interval) + 1);
> for (i = 0; i < BOND_MAX_ARP_TARGETS; i++)
> new_slave->target_last_arp_rx[i] = new_slave->last_rx;
>
[Severity: Medium]
Just after this hunk, bond_enslave() copies the same value into last_tx:
new_slave->last_tx = new_slave->last_rx;
So last_tx now also starts two intervals old. Could that cause a spurious
UP->DOWN transition in bond_loadbalance_arp_mon(), used by balance-rr,
balance-xor and broadcast with arp_interval set?
A slave enslaved with carrier OK starts as BOND_LINK_UP. On the first
arp_work pass, the UP branch checks last_tx before this slave's first
bond_send_validate() call in the same loop:
if (!bond_time_in_interval(bond, last_tx,
bond->params.missed_max) ||
!bond_time_in_interval(bond, READ_ONCE(slave->last_rx),
bond->params.missed_max)) {
bond_propose_link_state(slave, BOND_LINK_DOWN);
...
if (bond_slave_is_up(slave))
bond_send_validate(bond, slave);
Unlike bond_ab_arp_inspect(), this path has no last_link_up grace. The
comment there says each slave is given "as long as it needs to get the
tx/rx within the delta".
bond_time_in_interval() accepts jiffies up to:
last_act + mod * delta_in_ticks + delta_in_ticks/2
With d = arp_interval in jiffies, J0 = enslave time and the new seed
J0 - 2d - 1, the upper bound is:
missed_max = 2 (default): J0 + d/2 - 1
missed_max = 1: J0 - d/2 - 1
With the old seed and missed_max = 2 the bound was J0 + 1.5d - 1, which a
first tick at or before J0 + d never crossed.
The arp_work tick phase does not depend on when the slave is enslaved.
With default settings, does that mean roughly half of enslavements into a
running load-balance bond see the slave marked down on the first tick,
before any probe has gone out? With missed_max = 1, would every carrier-up
slave be marked down on its first tick?
When that happens, link_failure_count is incremented, "interface is now
down" is logged, and do_failover is set if this is curr_active_slave. The
link only comes back on the next tick, after the first ARP has been sent.
Documentation/networking/bonding.rst describes arp_missed_max as:
Specifies the number of arp_interval monitor checks that must
fail in order for an interface to be marked down by the ARP monitor.
The commit message says:
Seed last_rx (and with it the per-target array and last_tx) two
intervals in the past, so it is outside the slack window from the
start.
It does not mention the effect on the UP->DOWN checks in
bond_loadbalance_arp_mon(). Would it make sense to keep last_tx at its
previous seed, or to describe this behaviour change in the commit message?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261027-bonding-last-rx-v3-1-54907f1fb042%40well-founded.dev
Technical Details
Message-ID:
<179319031668.3134.15966773474485635933@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352843-linux-kernel-netdev=dewy.ruReferences:
<20261027-bonding-last-rx-v3-1-54907f1fb042@well-founded.dev>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-352843-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v3] bonding: fix initial last_rx vs ARP-monitor slack window Date: Wed, 28 Oct 2026 12:25:16 +0000 Organization: Usenet Network Message-ID: <179319031668.3134.15966773474485635933@kernel.org> References: <20261027-bonding-last-rx-v3-1-54907f1fb042@well-founded.dev> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1767457"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:RE3sM0VzZw9dL17uCdz1bn7i/1E= sha256:l9LNzomLjKzEC5B+LvQU9TWHm05nZ7S1bI9Ql0LTubk= sha1:nSlc3kO/LTUP90mQvi4YQiy6x5I= sha256:WyUfFPTxvIZqFj1dTnT9QxEA83ZxdX8aR1eyl0TgTYY= 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 46744125C35; Wed, 28 Oct 2026 15:25:56 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, 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] 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 KdRjRqJicmhc; Wed, 28 Oct 2026 15:25:48 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-352843-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 7F5D0125C34; Wed, 28 Oct 2026 15:25:39 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 5B64C601709; Wed, 28 Oct 2026 12:25:31 +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=1793190324; b=KWwmX2zUdMMM8E/8epEbxxI072Fk2ZfT2xVTrTPNZ9ejwqVZHu0cfS27A5UhbSUL2M72 L5eHLKnFHW8O9swWEjFr0RSMccLkL8WsgSlQd3AkRwtrDk4hZ3Wkz1p+WYdk3ab4Yx/M0 4h8kkrmq1o4Q6myovUwl+9u8Dn9aSvIaCte69lVFJ8d1YOBnis9+CdJZDlWN4IBXxRjbO aLeMR7hbvkx4qGVXDw97NZ5I3jSmcXOUftIhrHOQsOjk8QMNXbw/bG47NmCcOK1u/GBYw scMeCg3ggVKBG8gOdGNflD/SdJqdak0B3WAxTy2VbH1N7yEMt/tTPHT0h+tNM5YL/uA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793190324; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=s4OWMi3a8s2wA4xLjiaf+j11RhfHAHM82llxPPU2rPM=; b=yOv+IFl6RvcVkCY+wzfbCDCmQvaWREFmUi0O0ATKIvr65jytAzXLJG5VhTb50hdgnKXT UPVI+Q9igUofhHmffffWiv0qQ4x3OVKfawN6LVykcv8cThAdwetgbouIa50JOZQTYmGEe RhLxiktrzHea5oPU+AD1K4ndTi0vbJwEYwmY5Y/MZeOXkhabIbFilvPo1YdxQP0XeLexK P0FXjqAE1NiEyxxbcxmV3E6HtmTqaHVtaABi7jqv9E9SDcypMAW9pcySsAZZ75YbPviqm TEPqwG98OhLD4umVNSBL1dgJWkoCAW6Izzoq8WVR395AnDuHLG0Vp/+9QAkDf8Lx+Hg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D9Y6eDhf; 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 4472960A260B; Wed, 28 Oct 2026 12:25:24 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D9Y6eDhf X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793190318; b=Bk7jligkVJGjN78Rrg4L4bGDqB8d32RESIa3DQCjrHRR4EiHI7girbB4IN/OgOUfirrz KviClwF3+qowMIpxBGAH8buqqL9cV2V5BozqVWj7WNqNFzKgzrMpHS4b58GB2A0F4gt6L evNy6SjdGpTecLCRpnf72XyX6nRH9CiLzDJC5gGsTdfo7RakjnFtBaqk30+dsODaDOhvt ThZ9ytU9ipSMrCIs5tk2VOgj1J8LrpKUdAwoKvmLEAnZh6B81RD5cAa1vuRFzxZOYYuNO XsFg48vTc2iT0OKuTL9quGoAmFJDDdsXnnmzbHtzW4zwErlyY5NIFsWaa8bvRkj22yw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793190318; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=s4OWMi3a8s2wA4xLjiaf+j11RhfHAHM82llxPPU2rPM=; b=1WfBFBWn4zmMe1uW34h0rlIFlTS7lYo4vgBMWIjEFDEBZeqBqvJ5a+hFmFFsvbti+FYk nzojK7sojjLFfjC7hFHPoC3X12ewjK4mBkSDpJvAhGPHtA3PCOzsOEDOolwARJMzuVRuI cw3aGwIpW+A6PWL2oz6GZUNGyoNElx+UoYD/IeKXW0m7p95SufOVyc3uUzQMLrmUDP6GV pdzUFWWBnK5sKC3B/j30Tp2CaKIubN8c6EJ8KznKuJOQ7Rw/Zz20cgfwtyAofs7asx7Gs CUstDPbGs+rkkdT1WtOpIrzgNzVdzLh5o6WIAMMf8t6HzBpgjChIDcdGaYvrd6VjsNg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D9Y6eDhf; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 193D9606A31A; Wed, 28 Oct 2026 12:25:17 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22DA11F01825; Wed, 28 Oct 2026 12:25:17 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793190317; bh=s4OWMi3a8s2wA4xLjiaf+j11RhfHAHM82llxPPU2rPM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=D9Y6eDhfcdUsVH6F3wKJudaPj7jPaGHuZORFmOjXXcbSKHAU1uhVxVXLARYT5V5al jpEOTV4dygvds5SG4gyqbHvCAGElNhUnGxxZREz+e+5RFHLOoO16yzI3lpLH/s3EZH /XY6Y/OR2A43RpPdgt09SJ51P5Aigg9cYK9l4T2KwNFCLw0iV0dM8ioE4OE1P2o09d 3LRajvFZXdPywZmCrxTzUmNmgQhJERuRG3Mq2dZVny5q1i5ZCknxZIFPaKjcE3NtW3 GGwi1wUe82jPFo5v+xzBx+tMFvBV0gdnYhMtxmb6xsikTUj2fphiNcpMs+w9j1sn6S iebHacYGO7Mfw== X-Cc: jv@jvosburgh.net, andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, jbohac@suse.cz, edumazet@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, razor@blackwall.org, liuhangbin@kylinos.cn X-In-Reply-To: <20261027-bonding-last-rx-v3-1-54907f1fb042@well-founded.dev> X-sashiko-severity: Medium 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