]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r367719:
authorHans Petter Selasky <hselasky@FreeBSD.org>
Tue, 1 Dec 2020 13:09:04 +0000 (13:09 +0000)
committerHans Petter Selasky <hselasky@FreeBSD.org>
Tue, 1 Dec 2020 13:09:04 +0000 (13:09 +0000)
commita398dd340b3fbdd8125439c82aeb58e0a2f2030a
tree5bb1c516753f873793e46479c3ee76319ac18840
parenta3942b0737b66c207ecaa2901769226474e77058
MFC r367719:
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

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