Page MenuHomeFreeBSD

mlx5: fix deadlock in mlx5_fs_tree.c
ClosedPublic

Authored by mm on Oct 26 2023, 11:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 3:01 PM
Unknown Object (File)
Mon, Apr 1, 1:14 PM
Unknown Object (File)
Feb 10 2024, 10:51 PM
Unknown Object (File)
Dec 23 2023, 1:58 AM
Unknown Object (File)
Dec 21 2023, 12:50 AM
Unknown Object (File)
Dec 14 2023, 10:58 AM
Unknown Object (File)
Nov 29 2023, 2:38 AM
Unknown Object (File)
Nov 28 2023, 2:30 AM
Subscribers

Details

Summary

If removing a node of type FS_TYPE_FLOW_DEST we lock the flow group too late. This can lead to a deadlock and conflict with fs_add_dst_fg().
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274715

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mm requested review of this revision.Oct 26 2023, 11:13 AM

Wouldn't it be better to toggle the IFCAP2_BIT(IFCAP2_RXTLS4) and IFCAP2_BIT(IFCAP2_RXTLS6) than to add the check in mlx5e_tls_rx_snd_tag_alloc()?

Looks like we can already set "-rxtls" on network interfaces, it just isn't documented in ifconfig manual page.
So I am withdrawing this revision - the workaround is to disable rxtls.

mm updated this revision to Diff 129478.
mm retitled this revision from mlx5: make KTLS RX support tunable and disable by default to mlx5: fix deadlock in mlx5_fs_tree.c.
mm edited the summary of this revision. (Show Details)
mm added a reviewer: kib.

We (Nvidia) have the large rework of the flow steering code sitting in the internal branch. I hope to have the time to extract and prepare that code for commit later this week. Then, the fix could be no longer needed, or forward-ported to new fs code. I need to discuss it with the author.

sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c
1722

Then you would need to add an assert there?

I have updated the patch with the assert.

Linuxkpi mutexes are FreeBSD' sx.

In other source files of the mlx5 driver the same "mtx_assert" syntax is used to assert sx locks, I wanted to stay consistent. If you want I can replace it with sx_assert().

In D42368#967484, @mm wrote:

In other source files of the mlx5 driver the same "mtx_assert" syntax is used to assert sx locks, I wanted to stay consistent. If you want I can replace it with sx_assert().

Can you point out these places, please?

Ok, so when I understand it correctly, in the linuxkpi the "struct mutex" is a shared/exclusive lock sx(9) and "struct mtx" is mutex for thread synchronization mutex(9).

I am updating the patch.

I have tested the patch on a semi-production system with 30000 ifnet ktls sessions and 50Gbit/s traffic. Is it ok to go in?

This revision was not accepted when it landed; it landed in state Needs Review.Nov 16 2023, 11:18 AM
This revision was automatically updated to reflect the committed changes.