[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <165730.1724372277@famine>
Date: Thu, 22 Aug 2024 17:17:57 -0700
From: Jay Vosburgh <jv@...sburgh.net>
To: Jianbo Liu <jianbol@...dia.com>
cc: "liuhangbin@...il.com" <liuhangbin@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>,
Leon Romanovsky <leonro@...dia.com>, Gal Pressman <gal@...dia.com>,
"andy@...yhouse.net" <andy@...yhouse.net>,
Tariq Toukan <tariqt@...dia.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"edumazet@...gle.com" <edumazet@...gle.com>,
Saeed Mahameed <saeedm@...dia.com>,
"kuba@...nel.org" <kuba@...nel.org>
Subject: Re: [PATCH net V5 3/3] bonding: change ipsec_lock from spin lock to
mutex
Jianbo Liu <jianbol@...dia.com> wrote:
[...]
>I think it's good solution.
>So I need to add the dev_hold/dev_put as following, for example, for
>bond_ipsec_del_sa, right?
>
>@@ -526,6 +534,7 @@ static void bond_ipsec_del_sa(struct xfrm_state *xs)
> bond = netdev_priv(bond_dev);
> slave = rcu_dereference(bond->curr_active_slave);
> real_dev = slave ? slave->dev : NULL;
>+ dev_hold(real_dev);
> rcu_read_unlock();
>
> if (!slave)
>@@ -545,6 +554,7 @@ static void bond_ipsec_del_sa(struct xfrm_state *xs)
>
> real_dev->xfrmdev_ops->xdo_dev_state_delete(xs);
> out:
>+ dev_put(real_dev);
> mutex_lock(&bond->ipsec_lock);
> list_for_each_entry(ipsec, &bond->ipsec_list, list) {
> if (ipsec->xs == xs) {
>
>If you are ok with that, I will add the same for
>bond_ipsec_add_sa/bond_ipsec_free_sa, and send new version.
Yes, I think that will work, but please use netdev_hold() as
Jakub requested.
-J
---
-Jay Vosburgh, jv@...sburgh.net
Powered by blists - more mailing lists