Page MenuHomeFreeBSD

nvme: Add exclusion for ISR
ClosedPublic

Authored by imp on Aug 14 2023, 7:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 13, 2:11 AM
Unknown Object (File)
Sat, May 11, 10:08 AM
Unknown Object (File)
Tue, Apr 30, 3:41 PM
Unknown Object (File)
Tue, Apr 30, 3:41 PM
Unknown Object (File)
Tue, Apr 30, 3:41 PM
Unknown Object (File)
Tue, Apr 30, 3:41 PM
Unknown Object (File)
Tue, Apr 30, 3:41 PM
Unknown Object (File)
Tue, Apr 30, 3:40 PM
Subscribers

Details

Summary

Add a basically uncontended spinlock that we take out while the ISR is
running. This has two effects: First, when we get a timeout, we can
safely call the nvme_qpair_process_completions w/o racing any ISRs.
Second, we can use it to ensure that we don't reset the card while
the ISRs are active (right now we just sleep and hope for the best,
which usually is fine, but not always).

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Aug 14 2023, 7:23 PM

Don't you need a mtx_init() ? Or did I just miss it..?

sys/dev/nvme/nvme_private.h
204

struct mtx_padalign does what you want

update, per drew's review

This revision is now accepted and ready to land.Aug 14 2023, 8:44 PM

update per jhb's observation that my locking was screwed up

This revision now requires review to proceed.Aug 15 2023, 3:33 AM
sys/dev/nvme/nvme_ctrlr.c
1757

Is the call to nvme_pre_reset() needed here? Both paths to fail occur after the initial call to nvme_pre_reset()

sys/dev/nvme/nvme_qpair.c
551

New-line?

sys/dev/nvme/nvme_ctrlr.c
1757

This needs to be nvme_post_reset() since we called nvme_pre_reset() before jumping to fail.

sys/dev/nvme/nvme_qpair.c
551

Oh yea. other code was there briefly during development, but it's gone now.

update per chuck's feedback

This revision is now accepted and ready to land.Aug 15 2023, 9:01 PM
This revision was automatically updated to reflect the committed changes.