[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <13131adc-1e61-46ae-a48e-ab2b51037a98@blackwall.org>
Date: Tue, 25 Jun 2024 10:11:53 +0300
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: Hangbin Liu <liuhangbin@...il.com>, netdev@...r.kernel.org
Cc: Jay Vosburgh <j.vosburgh@...il.com>, Andy Gospodarek
<andy@...yhouse.net>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCHv2 net-next] bonding: 3ad: send ifinfo notify when mux
state changed
On 25/06/2024 10:00, Hangbin Liu wrote:
> Currently, administrators need to retrieve LACP mux state changes from
> the kernel DEBUG log using netdev_dbg and slave_dbg macros. To simplify
> this process, let's send the ifinfo notification whenever the mux state
> changes. This will enable users to directly access and monitor this
> information using the ip monitor command.
>
> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
> ---
> v2: don't use call_netdevice_notifiers as it will case sleeping in atomic
> context (Nikolay Aleksandrov)
> ---
> drivers/net/bonding/bond_3ad.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> index c6807e473ab7..7a7224bf1894 100644
> --- a/drivers/net/bonding/bond_3ad.c
> +++ b/drivers/net/bonding/bond_3ad.c
> @@ -1185,6 +1185,8 @@ static void ad_mux_machine(struct port *port, bool *update_slave_arr)
> default:
> break;
> }
> +
> + rtmsg_ifinfo(RTM_NEWLINK, port->slave->dev, 0, GFP_KERNEL, 0, NULL);
> }
> }
>
GFP_KERNEL still allows to sleep, this is where I meant use GFP_ATOMIC if
under the locks in my previous comment.
Also how does an administrator undestand that the mux state changed by
using the above msg? Could you show the iproute2 part and how it looks for
anyone monitoring?
Powered by blists - more mailing lists