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)
Fri, Oct 18, 12:55 PM
Unknown Object (File)
Sep 5 2024, 10:51 AM
Unknown Object (File)
Aug 31 2024, 10:56 PM
Unknown Object (File)
Aug 27 2024, 12:59 AM
Unknown Object (File)
Aug 16 2024, 6:50 AM
Unknown Object (File)
Aug 7 2024, 3:52 AM
Unknown Object (File)
Jul 16 2024, 6:10 AM
Unknown Object (File)
Jul 9 2024, 6:05 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 53096
Build 49987: arc lint + arc unit

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
207

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
1751

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
561

New-line?

sys/dev/nvme/nvme_ctrlr.c
1751

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

sys/dev/nvme/nvme_qpair.c
561

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.