From: Jiri Pirko <jiri@resnulli.us>
To: Ivan Vecera <ivecera@redhat.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net] team: don't call netdev_change_features under team->lock
Date: Wed, 25 May 2016 17:00:40 +0200 [thread overview]
Message-ID: <20160525150040.GA2065@nanopsycho.orion> (raw)
In-Reply-To: <1464188149-9383-1-git-send-email-ivecera@redhat.com>
Wed, May 25, 2016 at 04:55:49PM CEST, ivecera@redhat.com wrote:
>The team_device_event() notifier calls team_compute_features() to fix
>vlan_features under team->lock to protect team->port_list. The problem is
>that subsequent __team_compute_features() calls netdev_change_features()
>to propagate vlan_features to upper vlan devices while team->lock is still
>taken. This can lead to deadlock when NETIF_F_LRO is modified on lower
>devices or team device itself.
>
>Example:
>The team0 as active backup with eth0 and eth1 NICs. Both eth0 & eth1 are
>LRO capable and LRO is enabled. Thus LRO is also enabled on team0.
>
>The command 'ethtool -K team0 lro off' now hangs due to this deadlock:
>
>dev_ethtool()
>-> ethtool_set_features()
> -> __netdev_update_features(team)
> -> netdev_sync_lower_features()
> -> netdev_update_features(lower_1)
> -> __netdev_update_features(lower_1)
> -> netdev_features_change(lower_1)
> -> call_netdevice_notifiers(...)
> -> team_device_event(lower_1)
> -> team_compute_features(team) [TAKES team->lock]
> -> netdev_change_features(team)
> -> __netdev_update_features(team)
> -> netdev_sync_lower_features()
> -> netdev_update_features(lower_2)
> -> __netdev_update_features(lower_2)
> -> netdev_features_change(lower_2)
> -> call_netdevice_notifiers(...)
> -> team_device_event(lower_2)
> -> team_compute_features(team) [DEADLOCK]
>
>Cc: Jiri Pirko <jiri@resnulli.us>
>
>Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Please add "Fixes:" line.
Thanks!
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
prev parent reply other threads:[~2016-05-25 15:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 14:55 [PATCH net] team: don't call netdev_change_features under team->lock Ivan Vecera
2016-05-25 15:00 ` Jiri Pirko [this message]
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=20160525150040.GA2065@nanopsycho.orion \
--to=jiri@resnulli.us \
--cc=ivecera@redhat.com \
--cc=netdev@vger.kernel.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