From: Andrew Lunn <andrew@lunn.ch>
To: "Íñigo Huguet" <ihuguet@redhat.com>
Cc: irusskikh@marvell.com, dbogdanov@marvell.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org,
Li Liang <liali@redhat.com>
Subject: Re: [PATCH net] atlantic: fix deadlock at aq_nic_stop
Date: Sat, 15 Oct 2022 17:09:34 +0200 [thread overview]
Message-ID: <Y0rNLpmCjHVoO+D1@lunn.ch> (raw)
In-Reply-To: <CACT4oudn-sS16O7_+eihVYUqSTqgshbbqMFRBhgxkgytphsN-Q@mail.gmail.com>
> > Maybe the lock needs to be moved closer to what actually needs to be
> > protect? What is it protecting?
>
> It's protecting the operations of aq_macsec_enable and aq_macsec_work.
> The locking was closer to them, but the idea of this patch is to move
> the locking to an earlier moment so, in the case we need to abort, do
> it before changing anything.
aq_check_txsa_expiration() seems to be one of the issues? At least,
the lock is taken before and released afterwards. So what in
aq_check_txsa_expiration() requires the lock?
I don't like the use of rtnl_trylock(). It suggests the basic design is
wrong, or overly complex, and so probably not working correctly.
https://blog.ffwll.ch/2022/07/locking-engineering.html
Please try to identify what is being protected. If it is driver
internal state, could it be replaced with a driver mutex, rather than
RTNL? Or is it network stack as a whole state, which really does
require RTNL? If so, how do other drivers deal with this problem? Is
it specific to MACSEC? Does MACSEC have a design problem?
Andrew
next prev parent reply other threads:[~2022-10-15 15:09 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-14 10:34 [PATCH net] atlantic: fix deadlock at aq_nic_stop Íñigo Huguet
2022-10-14 12:13 ` Andrew Lunn
2022-10-14 12:43 ` Íñigo Huguet
2022-10-14 13:35 ` Andrew Lunn
2022-10-14 13:44 ` Íñigo Huguet
2022-10-15 15:09 ` Andrew Lunn [this message]
2022-10-17 7:22 ` Íñigo Huguet
2022-10-18 0:27 ` Andrew Lunn
2022-10-18 2:44 ` Jakub Kicinski
2022-10-18 6:15 ` Íñigo Huguet
2022-10-18 15:59 ` Jakub Kicinski
2022-10-19 6:18 ` Íñigo Huguet
2022-10-19 15:39 ` Jakub Kicinski
2022-10-20 7:46 ` Íñigo Huguet
2022-10-18 6:11 ` Íñigo Huguet
2022-10-20 7:53 ` [PATCH v2 " Íñigo Huguet
2022-10-20 8:55 ` Igor Russkikh
2022-10-20 16:17 ` Íñigo Huguet
2022-10-21 19:01 ` Íñigo Huguet
2022-10-24 9: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=Y0rNLpmCjHVoO+D1@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=dbogdanov@marvell.com \
--cc=edumazet@google.com \
--cc=ihuguet@redhat.com \
--cc=irusskikh@marvell.com \
--cc=kuba@kernel.org \
--cc=liali@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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.