All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carlos Bilbao <carlos.bilbao.osdev@gmail.com>
To: "Seth Forshee (DigitalOcean)" <sforshee@kernel.org>,
	Jay Vosburgh <jv@jvosburgh.net>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Carlos Bilbao <carlos.bilbao@kernel.org>,
	Tonghao Zhang <tonghao@bamaicloud.com>
Subject: Re: [PATCH] bonding: don't force LACPDU tx to ~333 ms boundaries
Date: Wed, 25 Jun 2025 11:13:12 -0500	[thread overview]
Message-ID: <1eeb3e3f-8acc-484b-b9c2-700516aa5cba@gmail.com> (raw)
In-Reply-To: <20250625-fix-lacpdu-jitter-v1-1-4d0ee627e1ba@kernel.org>

Hello,

On 6/25/25 11:01, Seth Forshee (DigitalOcean) wrote:
> The timer which ensures that no more than 3 LACPDUs are transmitted in
> a second rearms itself every 333ms regardless of whether an LACPDU is
> transmitted when the timer expires. This causes LACPDU tx to be delayed
> until the next expiration of the timer, which effectively aligns LACPDUs
> to ~333ms boundaries. This results in a variable amount of jitter in the
> timing of periodic LACPDUs.
>
> Change this to only rearm the timer when an LACPDU is actually sent,
> allowing tx at any point after the timer has expired.
>
> Signed-off-by: Seth Forshee (DigitalOcean) <sforshee@kernel.org>
> ---
>   drivers/net/bonding/bond_3ad.c | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> index c6807e473ab706afed9560bcdb5e6eca1934f5b7..a8d8aaa169fc09d7d5c201ff298b37b3f11a7ded 100644
> --- a/drivers/net/bonding/bond_3ad.c
> +++ b/drivers/net/bonding/bond_3ad.c
> @@ -1378,7 +1378,7 @@ static void ad_tx_machine(struct port *port)
>   	/* check if tx timer expired, to verify that we do not send more than
>   	 * 3 packets per second
>   	 */
> -	if (port->sm_tx_timer_counter && !(--port->sm_tx_timer_counter)) {
> +	if (!port->sm_tx_timer_counter || !(--port->sm_tx_timer_counter)) {
>   		/* check if there is something to send */
>   		if (port->ntt && (port->sm_vars & AD_PORT_LACP_ENABLED)) {
>   			__update_lacpdu_from_port(port);
> @@ -1393,12 +1393,13 @@ static void ad_tx_machine(struct port *port)
>   				 * again until demanded
>   				 */
>   				port->ntt = false;
> +
> +				/* restart tx timer(to verify that we will not
> +				 * exceed AD_MAX_TX_IN_SECOND
> +				 */
> +				port->sm_tx_timer_counter = ad_ticks_per_sec / AD_MAX_TX_IN_SECOND;
>   			}
>   		}
> -		/* restart tx timer(to verify that we will not exceed
> -		 * AD_MAX_TX_IN_SECOND
> -		 */
> -		port->sm_tx_timer_counter = ad_ticks_per_sec/AD_MAX_TX_IN_SECOND;
>   	}
>   }


Reviewed-by: Carlos Bilbao <carlos.bilbao@kernel.org>


>   
>
> ---
> base-commit: 86731a2a651e58953fc949573895f2fa6d456841
> change-id: 20250625-fix-lacpdu-jitter-1554d9f600ab
>
> Best regards,


Thanks,

Carlos


  reply	other threads:[~2025-06-25 16:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25 16:01 [PATCH] bonding: don't force LACPDU tx to ~333 ms boundaries Seth Forshee (DigitalOcean)
2025-06-25 16:13 ` Carlos Bilbao [this message]
2025-06-25 16:30 ` Jay Vosburgh
2025-06-25 17:00   ` Seth Forshee (DigitalOcean)
2025-07-01  8:10     ` Paolo Abeni
2025-07-03 13:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1eeb3e3f-8acc-484b-b9c2-700516aa5cba@gmail.com \
    --to=carlos.bilbao.osdev@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=carlos.bilbao@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sforshee@kernel.org \
    --cc=tonghao@bamaicloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.