Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/pci_nvme.c
Show First 20 Lines • Show All 738 Lines • ▼ Show 20 Lines | |||||
* Note that while the NVMe spec doesn't require Controllers to return AER's | * Note that while the NVMe spec doesn't require Controllers to return AER's | ||||
* in order, this implementation does preserve the order. | * in order, this implementation does preserve the order. | ||||
*/ | */ | ||||
static int | static int | ||||
pci_nvme_aer_add(struct pci_nvme_softc *sc, uint16_t cid) | pci_nvme_aer_add(struct pci_nvme_softc *sc, uint16_t cid) | ||||
{ | { | ||||
struct pci_nvme_aer *aer = NULL; | struct pci_nvme_aer *aer = NULL; | ||||
if (pci_nvme_aer_limit_reached(sc)) | |||||
return (-1); | |||||
aer = calloc(1, sizeof(struct pci_nvme_aer)); | aer = calloc(1, sizeof(struct pci_nvme_aer)); | ||||
if (aer == NULL) | if (aer == NULL) | ||||
return (-1); | return (-1); | ||||
/* Save the Command ID for use in the completion message */ | /* Save the Command ID for use in the completion message */ | ||||
aer->cid = cid; | aer->cid = cid; | ||||
pthread_mutex_lock(&sc->aer_mtx); | pthread_mutex_lock(&sc->aer_mtx); | ||||
▲ Show 20 Lines • Show All 2,411 Lines • Show Last 20 Lines |