From: Hangbin Liu <hangbin.liu@linux.dev>
To: Nikolay Aleksandrov <razor@blackwall.org>
Cc: 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>,
Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Hangbin Liu <liuhangbin@kylinos.cn>
Subject: Re: [PATCH net v3 1/2] bonding: convert unbalanced_load to per-cpu state
Date: Wed, 19 Aug 2026 09:11:33 +0800 [thread overview]
Message-ID: <aoUCxTFtxSjW6zZv@fedora> (raw)
In-Reply-To: <fb48d9f3-f0f8-4532-aa4f-de8fa1a13f6a@blackwall.org>
On Tue, Aug 18, 2026 at 12:42:10PM +0300, Nikolay Aleksandrov wrote:
> > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> > index 522eab060f9e..9fb44e0031c8 100644
> > --- a/drivers/net/bonding/bond_main.c
> > +++ b/drivers/net/bonding/bond_main.c
> > @@ -5995,6 +5995,7 @@ static void bond_destructor(struct net_device *bond_dev)
> > destroy_workqueue(bond->wq);
> > free_percpu(bond->rr_tx_counter);
> > + free_percpu(bond->alb_info.unbalanced_load);
> > }
> > void bond_setup(struct net_device *bond_dev)
> > @@ -6494,6 +6495,10 @@ static int bond_init(struct net_device *bond_dev)
> > if (!bond->wq)
> > return -ENOMEM;
> > + bond->alb_info.unbalanced_load = alloc_percpu(struct unbalanced_load_stats);
> > + if (!bond->alb_info.unbalanced_load)
> > + goto wq_out;
> > +
>
> The bond doesn't generally depend on this struct and shouldn't fail to init
> if it fails to allocate and the user hasn't chosen alb mode. Also here is too
> early to tell, the netlink mode hasn't been applied yet.
> Maybe the allocation could be moved to bond_alb_initialize and the freeing to
> bond_alb_deinitialize?
Makes sense. Let me move it to tlb_initialize/tlb_deinitialize.
Thanks
Hangbin
next prev parent reply other threads:[~2026-08-19 1:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 8:47 [PATCH net v3 0/2] bonding: fix TLB load-tracking overflow on high-speed NICs Hangbin Liu
2026-08-18 8:47 ` [PATCH net v3 1/2] bonding: convert unbalanced_load to per-cpu state Hangbin Liu
2026-08-18 9:42 ` Nikolay Aleksandrov
2026-08-19 1:11 ` Hangbin Liu [this message]
2026-08-18 8:47 ` [PATCH net v3 2/2] bonding: fix u32 overflow in compute_gap() Hangbin Liu
2026-08-18 9:44 ` Nikolay Aleksandrov
2026-08-18 11:06 ` Nikolay Aleksandrov
2026-08-18 11:51 ` Nikolay Aleksandrov
2026-08-19 2:07 ` Hangbin Liu
2026-08-19 2:09 ` Hangbin Liu
2026-08-19 8:35 ` Nikolay Aleksandrov
2026-08-19 9:51 ` Hangbin Liu
2026-08-19 10:02 ` Nikolay Aleksandrov
2026-08-19 10:14 ` Nikolay Aleksandrov
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=aoUCxTFtxSjW6zZv@fedora \
--to=hangbin.liu@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuhangbin@kylinos.cn \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox