]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Make mlx5_cmd_exec_cb() a safe API in mlx5core.
authorhselasky <hselasky@FreeBSD.org>
Mon, 16 Nov 2020 10:15:03 +0000 (10:15 +0000)
committerhselasky <hselasky@FreeBSD.org>
Mon, 16 Nov 2020 10:15:03 +0000 (10:15 +0000)
commit12cf8fdad6f3db260b6dbadd98f771da442d407a
treece5388e69e04d8d737b13cd6a57f3ece47b1f0e6
parentae4b617cd1a81b3d4995b3f4efe35519616f90dc
Make mlx5_cmd_exec_cb() a safe API in mlx5core.

APIs that have deferred callbacks should have some kind of cleanup
function that callers can use to fence the callbacks. Otherwise things
like module unloading can lead to dangling function pointers, or worse.

The IB MR code is the only place that calls this function and had a
really poor attempt at creating this fence. Provide a good version in
the core code as future patches will add more places that need this
fence.

Linux commit:
e355477ed9e4f401e3931043df97325d38552d54

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking
sys/dev/mlx5/driver.h
sys/dev/mlx5/mlx5_core/mlx5_cmd.c
sys/dev/mlx5/mlx5_core/mlx5_mr.c
sys/dev/mlx5/mlx5_ib/mlx5_ib.h
sys/dev/mlx5/mlx5_ib/mlx5_ib_mr.c