env: only pass failing address to spdk_pci_error_handler
siginfo_t is a GNU extension. SPDK (and DPDK) have direct dependencies on GNU extensions, but it's a bit nicer if external modules don't also need to define _GNU_SOURCE. Currently siginfo_t parameter in the spdk_pci_error_handler is the only thing that violates this. Note that DPDK also supports registering sigbus handlers, but they take the failing address as a parameter instead of the full siginfo_t structure. Let's adopt the same for SPDK. While here, remove an extra semicolon that was just after the virtio sigbus handler function signature that was updated in this patch. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I07faf11a3ac3589c637cb2196581c102286b1e68 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8333 Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Ziye Yang <ziye.yang@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot
This commit is contained in:
parent
f29acca244
commit
c4fafdb215
@ -1343,7 +1343,7 @@ struct spdk_pci_event {
|
||||
struct spdk_pci_addr traddr;
|
||||
};
|
||||
|
||||
typedef void (*spdk_pci_error_handler)(siginfo_t *info, void *ctx);
|
||||
typedef void (*spdk_pci_error_handler)(const void *failure_addr, void *ctx);
|
||||
|
||||
/**
|
||||
* Begin listening for PCI bus events. This is used to detect hot-insert and
|
||||
|
@ -34,7 +34,7 @@
|
||||
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..)
|
||||
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
||||
|
||||
SO_VER := 6
|
||||
SO_VER := 7
|
||||
SO_MINOR := 0
|
||||
|
||||
CFLAGS += $(ENV_CFLAGS)
|
||||
|
@ -53,7 +53,7 @@ sigbus_fault_sighandler(int signum, siginfo_t *info, void *ctx)
|
||||
|
||||
pthread_mutex_lock(&g_sighandler_mutex);
|
||||
TAILQ_FOREACH(sigbus_handler, &g_sigbus_handler, tailq) {
|
||||
sigbus_handler->func(info, sigbus_handler->ctx);
|
||||
sigbus_handler->func(info->si_addr, sigbus_handler->ctx);
|
||||
}
|
||||
pthread_mutex_unlock(&g_sighandler_mutex);
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ static bool g_sigset = false;
|
||||
static spdk_nvme_pcie_hotplug_filter_cb g_hotplug_filter_cb;
|
||||
|
||||
static void
|
||||
nvme_sigbus_fault_sighandler(siginfo_t *info, void *ctx)
|
||||
nvme_sigbus_fault_sighandler(const void *failure_addr, void *ctx)
|
||||
{
|
||||
void *map_address;
|
||||
uint16_t flag = 0;
|
||||
|
@ -89,9 +89,9 @@ static bool g_sigset = false;
|
||||
#define PCI_CAP_ID_MSIX 0x11
|
||||
|
||||
static void
|
||||
virtio_pci_dev_sigbus_handler(siginfo_t *info, void *ctx)
|
||||
virtio_pci_dev_sigbus_handler(const void *failure_addr, void *ctx)
|
||||
{
|
||||
void *map_address = NULL;;
|
||||
void *map_address = NULL;
|
||||
uint16_t flag = 0;
|
||||
int i;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user