From: Jiri Pirko <jiri@resnulli.us>
To: Ivan Vecera <ivecera@redhat.com>
Cc: netdev@vger.kernel.org, saeed@kernel.org
Subject: Re: [PATCH net] team: postpone features update to avoid deadlock
Date: Wed, 20 Jan 2021 14:40:25 +0100 [thread overview]
Message-ID: <20210120134025.GD3565223@nanopsycho.orion> (raw)
In-Reply-To: <20210120122354.3687556-1-ivecera@redhat.com>
Wed, Jan 20, 2021 at 01:23:54PM CET, ivecera@redhat.com wrote:
>Team driver protects port list traversal by its team->lock mutex
>in functions like team_change_mtu(), team_set_rx_mode(),
>team_vlan_rx_{add,del}_vid() etc.
>These functions call appropriate callbacks of all enslaved
>devices. Some drivers need to update their features under
>certain conditions (e.g. TSO is broken for jumbo frames etc.) so
>they call netdev_update_features(). This causes a deadlock because
>netdev_update_features() calls netdevice notifiers and one of them
>is team_device_event() that in case of NETDEV_FEAT_CHANGE tries lock
>team->lock mutex again.
>
>Example (r8169 case):
>...
>[ 6391.348202] __mutex_lock.isra.6+0x2d0/0x4a0
>[ 6391.358602] team_device_event+0x9d/0x160 [team]
>[ 6391.363756] notifier_call_chain+0x47/0x70
>[ 6391.368329] netdev_update_features+0x56/0x60
>[ 6391.373207] rtl8169_change_mtu+0x14/0x50 [r8169]
>[ 6391.378457] dev_set_mtu_ext+0xe1/0x1d0
>[ 6391.387022] dev_set_mtu+0x52/0x90
>[ 6391.390820] team_change_mtu+0x64/0xf0 [team]
>[ 6391.395683] dev_set_mtu_ext+0xe1/0x1d0
>[ 6391.399963] do_setlink+0x231/0xf50
>...
>
>To fix the problem __team_compute_features() needs to be postponed
>for these cases.
>
>Fixes: 3d249d4ca7d0 ("net: introduce ethernet teaming device")
>Cc: Jiri Pirko <jiri@resnulli.us>
>Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
next prev parent reply other threads:[~2021-01-20 21:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-20 12:23 [PATCH net] team: postpone features update to avoid deadlock Ivan Vecera
2021-01-20 13:40 ` Jiri Pirko [this message]
2021-01-20 23:18 ` Cong Wang
2021-01-21 10:29 ` Ivan Vecera
2021-01-22 2:34 ` Jakub Kicinski
2021-01-22 8:30 ` Ivan Vecera
2021-01-22 18:03 ` Jakub Kicinski
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=20210120134025.GD3565223@nanopsycho.orion \
--to=jiri@resnulli.us \
--cc=ivecera@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=saeed@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 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.