[PATCH] kni: fix kernel deadlock due to async changes
Ferruh Yigit
ferruh.yigit at intel.com
Tue Nov 23 10:40:42 CET 2021
On 10/11/2021 7:35 AM, Sahithi Singam wrote:
> From: Sahithi Singam <sahithi.singam at oracle.com <mailto:sahithi.singam at oracle.com>>
>
> Async user request changes resulted in a kernel deadlock when used with linux kernel version>= 5.12.
>
> Starting from linux kernel version 5.12, a new global semaphore dev_addr_sem was introduced in dev_set_mac_address_user() function that should be acquired and released along with rtnl_lock when a mac address set request was received from userspace.
>
> When a mac address set request is received on KNI interface, before sending request to userspace, kni code is releasing rtnl_lock without releasing dev_addr_sem semaphore. After receiving a response it is again trying to hold rtnl_lock. These changes were added as part of async user request changes to fix a kernel deadlock with bifurcated devices.
>
> This code is resulting in deadlock as kni is just releasing rtnl_lock without releasing semaphore while mac address set request on some other device could have acquired rtnl_lock and could be waiting for dev_addr_sem held by the current device.
>
> As a solution, support async user request changes based on a module parameter. This will limit kernel deadlock issue to users using KNI over bifurcated devices with kernel versions >= 5.12.
>
> Bugzilla ID: 816
>
> Fixes: 631217c76135 ("kni: fix kernel deadlock with bifurcated device")
>
> Cc: eladv6 at gmail.com <mailto:eladv6 at gmail.com>
>
> Signed-off-by: Sahithi Singam <sahithi.singam at oracle.com <mailto:sahithi.singam at oracle.com>>
>
Hi Sahithi,
Since the patch is in html format, it is not detected by patchwork
and we missed it.
Can you please check if this patch different from the one I have sent
for same purpose:
https://patches.dpdk.org/project/dpdk/patch/20211008235830.127167-1-ferruh.yigit@intel.com/
If they are same, would you be OK to continue with above one?
More information about the dev
mailing list