From 86e8085d581fee6fac2887b59f85ead2fab53a4b Mon Sep 17 00:00:00 2001 From: Jacek Kalwas Date: Mon, 9 Nov 2020 10:10:25 -0500 Subject: [PATCH] env: describe enumerate function detail behavior 2s asynchronous delay is introduced to avoid race conditions between user space software initialization and in-kernel device handling for newly inserted devices. Subsequent enumerate call after the delay shall allow for a successful device attachment. Signed-off-by: Jacek Kalwas Change-Id: I273111ae7a588ce5e15e593bbdfb223777c19071 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5060 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki --- include/spdk/env.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/spdk/env.h b/include/spdk/env.h index 9bee0fbcb1..15c91aa9ea 100644 --- a/include/spdk/env.h +++ b/include/spdk/env.h @@ -774,6 +774,11 @@ struct spdk_pci_driver *spdk_pci_nvme_get_driver(void); * on denylist. Because of that it becomes not possible to either use such * devices with another application or unbind the driver (e.g. vfio). * + * 2s asynchronous delay is introduced to avoid race conditions between + * user space software initialization and in-kernel device handling for + * newly inserted devices. Subsequent enumerate call after the delay + * shall allow for a successful device attachment. + * * \param driver Driver for a specific device type. * \param enum_cb Callback to be called for each non-attached PCI device. * \param enum_ctx Additional context passed to the callback function.