The NetBSD Project

CVS log for src/sys/dev/ic/nvme.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / dev / ic

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.44.2.7: download - view: text, markup, annotated - select for diffs
Tue Mar 12 09:59:31 2024 UTC (8 months, 4 weeks ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-4-RELEASE
Diff to: previous 1.44.2.6: preferred, colored; branchpoint 1.44: preferred, colored; next MAIN 1.45: preferred, colored
Changes since revision 1.44.2.6: +9 -3 lines
Pull up following revision(s) (requested by riastradh in ticket #1817):

	sys/dev/ic/nvme.c: revision 1.69

nvme(4): Disestablish admin q interrupt while suspended.

And re-establish on resume.  Fixes nvmectl(8) after a suspend/resume
cycle on some systems.

Adapted from a patch by mrg@.

PR kern/58025

Revision 1.67.4.1: download - view: text, markup, annotated - select for diffs
Tue Mar 12 09:58:26 2024 UTC (8 months, 4 weeks ago) by martin
Branches: netbsd-10
CVS tags: netbsd-10-0-RELEASE, netbsd-10-0-RC6
Diff to: previous 1.67: preferred, colored; next MAIN 1.68: preferred, colored
Changes since revision 1.67: +9 -3 lines
Pull up following revision(s) (requested by riastradh in ticket #633):

	sys/dev/ic/nvme.c: revision 1.69

nvme(4): Disestablish admin q interrupt while suspended.

And re-establish on resume.  Fixes nvmectl(8) after a suspend/resume
cycle on some systems.

Adapted from a patch by mrg@.

PR kern/58025

Revision 1.69: download - view: text, markup, annotated - select for diffs
Mon Mar 11 21:10:46 2024 UTC (9 months ago) by riastradh
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, HEAD
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +9 -3 lines
nvme(4): Disestablish admin q interrupt while suspended.

And re-establish on resume.  Fixes nvmectl(8) after a suspend/resume
cycle on some systems.

Adapted from a patch by mrg@.

PR kern/58025

Revision 1.68: download - view: text, markup, annotated - select for diffs
Sun Mar 10 04:49:22 2024 UTC (9 months ago) by mrg
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +8 -3 lines
nvme(4): don't write to INTMC register if in intx mode

this matches the handling of INTMS, both of which have the same
restrictions on access in MSI-X mode.

ideally, this register should be written to with a full set of
values for MSI (upto 32 bits), but trying to force MSI mode for
my test machine makes the system unstable.

tested with samsung SM981 256GB, samsung 980 PRO 1TB, and intel
760p 250G.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Tue Sep 13 10:14:20 2022 UTC (2 years, 2 months ago) by riastradh
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Branch point for: netbsd-10
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +4 -20 lines
nvme(4): Don't leak memory for queues on every resume.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Tue Aug 30 08:48:24 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +3 -3 lines
nvme(4): Actually check if bp is null as commented previously.

I had tested this change, but forgot to amend the commit before
exporting to CVS.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Tue Aug 30 01:13:10 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +3 -3 lines
nvme(4): If bp is null or bp->b_ci is not assigned, use curcpu().

curcpu() might be stale by the time we're done, but it's still safe
to pass it to cpu_index, and this is just used as a best-effort
mechanism to keep I/O on queues handled by the same CPU.

bp is not always provided, and bp->b_ci is not always assigned,
e.g. when dumping.  (If bp->b_ci is supposed to be always assigned,
then we need to audit all the paths into it to assign it in those
where it's not.)

Fixes dump on nvme.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Sat Aug 20 11:31:38 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +10 -2 lines
nvme(4): Read cqe flags and cid in that order.

Revision 1.63: download - view: text, markup, annotated - select for diffs
Mon Aug 15 10:15:59 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +6 -4 lines
nvme(4): KASSERT(A && B) -> KASSERT(A); KASSERT(B)

Revision 1.62: download - view: text, markup, annotated - select for diffs
Sun Aug 14 12:08:57 2022 UTC (2 years, 3 months ago) by jmcneill
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +43 -6 lines
nvme: Make sure that q_ccb_list is always accessed with the q lock held.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Sun Jul 31 12:02:28 2022 UTC (2 years, 4 months ago) by mlelstv
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +5 -5 lines
The namespace id is a 32bit value, in particular the "all namespaces" value
for global commands is 0xffffffff. While the driver only supports 16bit
numbers (device minor & 0xffff), we need to use the full value for pass
through commands.

This fixes e.g. logpage requests on the controller level.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Sat May 7 08:20:04 2022 UTC (2 years, 7 months ago) by skrll
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +91 -27 lines
Add support for Apple silicon NVME.  Ported from OpenBSD.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Tue Nov 16 06:58:33 2021 UTC (3 years ago) by skrll
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +4 -4 lines
Trailing whitespace

Revision 1.58: download - view: text, markup, annotated - select for diffs
Sat Aug 7 16:19:12 2021 UTC (3 years, 4 months ago) by thorpej
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +4 -5 lines
Merge thorpej-cfargs2.

Revision 1.57.4.1: download - view: text, markup, annotated - select for diffs
Wed Aug 4 20:14:42 2021 UTC (3 years, 4 months ago) by thorpej
Branches: thorpej-cfargs2
Diff to: previous 1.57: preferred, colored; next MAIN 1.58: preferred, colored
Changes since revision 1.57: +4 -5 lines
Adapt to CFARGS().

Revision 1.44.2.6: download - view: text, markup, annotated - select for diffs
Mon Jun 21 17:25:48 2021 UTC (3 years, 5 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-3-RELEASE
Diff to: previous 1.44.2.5: preferred, colored; branchpoint 1.44: preferred, colored
Changes since revision 1.44.2.5: +89 -7 lines
Pull up following revision(s) (requested by riastradh in ticket #1305):

	sys/dev/ic/nvmevar.h: revision 1.22
	sys/dev/ic/nvme.c: revision 1.56
	sys/dev/ic/nvme.c: revision 1.57
	sys/dev/pci/nvme_pci.c: revision 1.30

nvme(4): Add suspend/resume, derived from OpenBSD.

nvme(4): Move disestablishment of admin q interrupt to nvme_detach.

Nothing re-established this after suspend/resume, so attempting
suspend/resume/suspend would crash, and presumably we would miss
interrupts after resume.  This keeps the establish/disestablish more
symmetric in attach/detach.

Revision 1.55.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 17 04:46:28 2021 UTC (3 years, 5 months ago) by thorpej
Branches: thorpej-i2c-spi-conf
Diff to: previous 1.55: preferred, colored; next MAIN 1.56: preferred, colored
Changes since revision 1.55: +89 -7 lines
Sync w/ HEAD.

Revision 1.55.4.1: download - view: text, markup, annotated - select for diffs
Mon May 31 22:15:18 2021 UTC (3 years, 6 months ago) by cjep
Branches: cjep_staticlib_x
Diff to: previous 1.55: preferred, colored; next MAIN 1.56: preferred, colored
Changes since revision 1.55: +89 -7 lines
sync with head

Revision 1.57: download - view: text, markup, annotated - select for diffs
Sat May 29 10:48:23 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1
Branch point for: thorpej-cfargs2
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +4 -4 lines
nvme(4): Move disestablishment of admin q interrupt to nvme_detach.

Nothing re-established this after suspend/resume, so attempting
suspend/resume/suspend would crash, and presumably we would miss
interrupts after resume.  This keeps the establish/disestablish more
symmetric in attach/detach.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Sat May 29 08:46:38 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +89 -7 lines
nvme(4): Add suspend/resume, derived from OpenBSD.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Sat Apr 24 23:36:55 2021 UTC (3 years, 7 months ago) by thorpej
Branches: MAIN
CVS tags: cjep_staticlib_x-base
Branch point for: thorpej-i2c-spi-conf, cjep_staticlib_x
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +13 -7 lines
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
  actually needed.
- Don't be explicit about what interface attribute is attaching if
  the device only has one.  (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
  situations, making is visibly easier to see when indirect config is
  in play, and allowing for future change in semantics.  (As of now,
  this is just a wrapper around config_match(), but that is an
  implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance.  This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).

Revision 1.54.2.2: download - view: text, markup, annotated - select for diffs
Sun Mar 28 20:33:46 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.54.2.1: preferred, colored; branchpoint 1.54: preferred, colored; next MAIN 1.55: preferred, colored
Changes since revision 1.54.2.1: +13 -7 lines
- In nvme_rescan(), pass the locators used for matching to config_found()
  and use config_stdsubmatch().
- No need to be explicit about interface attribute, because we carry
  only one.

Revision 1.54.2.1: download - view: text, markup, annotated - select for diffs
Sun Mar 21 21:09:12 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +3 -3 lines
Give config_found() the same variadic arguments treatment as
config_search().  This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls.  Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.

Revision 1.51.2.2: download - view: text, markup, annotated - select for diffs
Sun Jan 3 16:34:58 2021 UTC (3 years, 11 months ago) by thorpej
Branches: thorpej-futex
Diff to: previous 1.51.2.1: preferred, colored; next MAIN 1.52: preferred, colored
Changes since revision 1.51.2.1: +5 -3 lines
Sync w/ HEAD.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Sun Dec 27 16:52:01 2020 UTC (3 years, 11 months ago) by jmcneill
Branches: MAIN
CVS tags: thorpej-futex-base, thorpej-cfargs-base
Branch point for: thorpej-cfargs
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +5 -3 lines
Zero DMA memory after load, and add PREREAD sync op after to ensure it is visible

Revision 1.51.2.1: download - view: text, markup, annotated - select for diffs
Mon Dec 14 14:38:06 2020 UTC (3 years, 11 months ago) by thorpej
Branches: thorpej-futex
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +9 -6 lines
Sync w/ HEAD.

Revision 1.30.2.9: download - view: text, markup, annotated - select for diffs
Mon Dec 7 20:05:36 2020 UTC (4 years ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-3-RELEASE
Diff to: previous 1.30.2.8: preferred, colored; branchpoint 1.30: preferred, colored; next MAIN 1.31: preferred, colored
Changes since revision 1.30.2.8: +8 -5 lines
Pull up following revision(s) (requested by kardel in ticket #1633):

	sys/dev/ic/nvme.c: revision 1.53

PR kern/55839:

handle multiple nvme_rescan()s correctly by doing the
name-space identify only once per nsid.
fixes issue where modloading triggers multiple
rescans.

Revision 1.44.2.5: download - view: text, markup, annotated - select for diffs
Mon Dec 7 20:04:07 2020 UTC (4 years ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-2-RELEASE
Diff to: previous 1.44.2.4: preferred, colored; branchpoint 1.44: preferred, colored
Changes since revision 1.44.2.4: +8 -5 lines
Pull up following revision(s) (requested by kardel in ticket #1144):

	sys/dev/ic/nvme.c: revision 1.53

PR kern/55839:

handle multiple nvme_rescan()s correctly by doing the
name-space identify only once per nsid.
fixes issue where modloading triggers multiple
rescans.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Fri Dec 4 23:03:11 2020 UTC (4 years ago) by kardel
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +8 -5 lines
PR kern/55839:
handle multiple nvme_rescan()s correctly by doing the
name-space identify only once per nsid.

fixes issue where modloading triggers multiple
rescans.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Tue Nov 10 07:39:12 2020 UTC (4 years, 1 month ago) by rin
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +3 -3 lines
One more fix for big-endian machines.

Now, ld(4) at nvme(4) works perfectly for aarch64eb!

Tested on ROCKPro64 and qemu-system-aarch64.

Revision 1.30.2.8: download - view: text, markup, annotated - select for diffs
Sun Sep 27 10:33:45 2020 UTC (4 years, 2 months ago) by martin
Branches: netbsd-8
Diff to: previous 1.30.2.7: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.2.7: +39 -10 lines
Pull up following revision(s) (requested by kardel in ticket #1610):

	sys/dev/ic/ld_nvme.c: revision 1.24 (patch)
	sys/dev/ic/nvme.c: revision 1.50 (patch)

PR kern/55674:
	move name space availability check from ld_nvme.c:ld_nvme_attach()
	to nvme.c:nvme_rescan().
	this avoids allocation of ld(4) instances for every possible
	name space, even if it is not usable. it also reduces the device
	node flood generated from that strategy.

Revision 1.44.2.4: download - view: text, markup, annotated - select for diffs
Sun Sep 27 10:30:16 2020 UTC (4 years, 2 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-1-RELEASE
Diff to: previous 1.44.2.3: preferred, colored; branchpoint 1.44: preferred, colored
Changes since revision 1.44.2.3: +35 -6 lines
Pull up following revision(s) (requested by kardel in ticket #1094):

	sys/dev/ic/ld_nvme.c: revision 1.24
	sys/dev/ic/nvme.c: revision 1.50

PR kern/55674:
	move name space availability check from ld_nvme.c:ld_nvme_attach()
	to nvme.c:nvme_rescan().
	this avoids allocation of ld(4) instances for every possible
	name space, even if it is not usable. it also reduces the device
	node flood generated from that strategy.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Thu Sep 24 09:59:11 2020 UTC (4 years, 2 months ago) by ryo
Branches: MAIN
Branch point for: thorpej-futex
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +4 -4 lines
no need to swap pt.cmd.cdwXX at nvme_set_number_of_queues(). cmd.cdwXX will be swapped in nvme_pt_fill().

Revision 1.50: download - view: text, markup, annotated - select for diffs
Tue Sep 22 11:53:10 2020 UTC (4 years, 2 months ago) by kardel
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +35 -6 lines
PR kern/55674:
	move name space availability check from ld_nvme.c:ld_nvme_attach()
	to nvme.c:nvme_rescan().
	this avoids allocation of ld(4) instances for every possible
	name space, even if it is not usable. it also reduces the device
	node flood generated from that strategy.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Tue Jul 28 15:59:19 2020 UTC (4 years, 4 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +3 -3 lines
say what is not configured in nvme_print()

Revision 1.39.2.2: download - view: text, markup, annotated - select for diffs
Mon Apr 13 08:04:21 2020 UTC (4 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.39.2.1: preferred, colored; branchpoint 1.39: preferred, colored; next MAIN 1.40: preferred, colored
Changes since revision 1.39.2.1: +35 -23 lines
Mostly merge changes from HEAD upto 20200411

Revision 1.48: download - view: text, markup, annotated - select for diffs
Tue Apr 7 07:25:41 2020 UTC (4 years, 8 months ago) by ryo
Branches: MAIN
CVS tags: phil-wifi-20200421, phil-wifi-20200411, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +8 -2 lines
avoid "panic: LOCKDEBUG: Mutex error: rw_vector_enter,309: spin lock held"

ok nonaka@. thanks

Revision 1.30.2.7: download - view: text, markup, annotated - select for diffs
Mon Nov 11 17:17:22 2019 UTC (5 years, 1 month ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-2-RELEASE
Diff to: previous 1.30.2.6: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.2.6: +18 -15 lines
Pull up following revision(s) (requested by nonaka in ticket #1432):

	sys/dev/ic/nvme.c: revision 1.47

nvme(4): Use the SET_FEATURES command to get the number of allocated queues.

Revision 1.44.2.3: download - view: text, markup, annotated - select for diffs
Mon Nov 11 17:15:42 2019 UTC (5 years, 1 month ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Diff to: previous 1.44.2.2: preferred, colored; branchpoint 1.44: preferred, colored
Changes since revision 1.44.2.2: +18 -15 lines
Pull up following revision(s) (requested by nonaka in ticket #415):

	sys/dev/ic/nvme.c: revision 1.47

nvme(4): Use the SET_FEATURES command to get the number of allocated queues.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Mon Nov 11 07:27:48 2019 UTC (5 years, 1 month ago) by nonaka
Branches: MAIN
CVS tags: phil-wifi-20200406, phil-wifi-20191119, is-mlppp-base, is-mlppp, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +18 -15 lines
nvme(4): Use the SET_FEATURES command to get the number of allocated queues.

Revision 1.44.2.2: download - view: text, markup, annotated - select for diffs
Thu Sep 26 19:13:14 2019 UTC (5 years, 2 months ago) by martin
Branches: netbsd-9
Diff to: previous 1.44.2.1: preferred, colored; branchpoint 1.44: preferred, colored
Changes since revision 1.44.2.1: +6 -2 lines
Pull up following revision(s) (requested by nonaka in ticket #248):

	sys/dev/ic/nvme.c: revision 1.46

nvme(4): Don't attach the device, if namespace not found.

Revision 1.30.2.6: download - view: text, markup, annotated - select for diffs
Thu Sep 26 18:23:13 2019 UTC (5 years, 2 months ago) by martin
Branches: netbsd-8
Diff to: previous 1.30.2.5: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.2.5: +6 -2 lines
Pull up following revision(s) (requested by nonaka in ticket #1390):

	sys/dev/ic/nvme.c: revision 1.46

nvme(4): Don't attach the device, if namespace not found.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Thu Sep 26 11:50:32 2019 UTC (5 years, 2 months ago) by nonaka
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +6 -2 lines
nvme(4): Don't attach the device, if namespace not found.

Revision 1.30.2.5: download - view: text, markup, annotated - select for diffs
Wed Sep 25 15:49:16 2019 UTC (5 years, 2 months ago) by martin
Branches: netbsd-8
Diff to: previous 1.30.2.4: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.2.4: +3 -3 lines
Pull up following revision(s) (requested by nonaka in ticket #1386):

	sys/dev/ic/nvme.c: revision 1.45

Don't set Phase Tag bit of Completion Queue entry at nvme_poll_done().

A new completion queue entry check incorrectly determined that there was
a Completion Queue entry for a command that was not submitted.

Fix PR kern/54275, PR kern/54503, PR kern/54532.

Revision 1.44.2.1: download - view: text, markup, annotated - select for diffs
Sun Sep 22 12:18:56 2019 UTC (5 years, 2 months ago) by martin
Branches: netbsd-9
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +3 -3 lines
Pull up following revision(s) (requested by nonaka in ticket #218):

	sys/dev/ic/nvme.c: revision 1.45

Don't set Phase Tag bit of Completion Queue entry at nvme_poll_done().

A new completion queue entry check incorrectly determined that there was
a Completion Queue entry for a command that was not submitted.

Fix PR kern/54275, PR kern/54503, PR kern/54532.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Fri Sep 20 05:32:42 2019 UTC (5 years, 2 months ago) by nonaka
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +3 -3 lines
Don't set Phase Tag bit of Completion Queue entry at nvme_poll_done().

A new completion queue entry check incorrectly determined that there was
a Completion Queue entry for a command that was not submitted.

Fix PR kern/54275, PR kern/54503, PR kern/54532.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Fri Jun 28 15:08:47 2019 UTC (5 years, 5 months ago) by jmcneill
Branches: MAIN
CVS tags: netbsd-9-base
Branch point for: netbsd-9
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +6 -7 lines
Fix a performance issue where one busy queue can starve all other queues.

In normal operations with multiple queues, the nvme driver will attempt
to schedule I/O requests on the submitting CPU. This breaks down when any
one of the queues becomes full; the driver returns EAGAIN to the disk
layer, which causes the disk layer to stop submitting more requests until
the blocked request is consumed. When space becomes available in the full
queue, it pulls the next buffer from the bufq and fills the queue again,
until finally hitting EAGAIN and preventing other queues from processing
requests.

Two changes here to fix the problem:

 - When processing requests from the bufq, attempt to assign them to the
   queue associated with the CPU that originated the request.
 - If that queue is busy, try to find another queue with available space
   before returning EAGAIN. This way, only when all queues are full will
   the disk layer stop submitting more requests.

Now for some real numbers. On a Rockchip RK3399 board (6 CPUs), with 6
concurrent readers:

Old code:
	4294967296 bytes transferred in 52.420 secs (81933752 bytes/sec)
	4294967296 bytes transferred in 53.969 secs (79582117 bytes/sec)
	4294967296 bytes transferred in 55.391 secs (77539082 bytes/sec)
	4294967296 bytes transferred in 55.649 secs (77179595 bytes/sec)
	4294967296 bytes transferred in 56.102 secs (76556402 bytes/sec)
	4294967296 bytes transferred in 72.901 secs (58915066 bytes/sec)

New code:
	4294967296 bytes transferred in 37.171 secs (115546186 bytes/sec)
	4294967296 bytes transferred in 37.611 secs (114194445 bytes/sec)
	4294967296 bytes transferred in 37.655 secs (114061009 bytes/sec)
	4294967296 bytes transferred in 38.247 secs (112295534 bytes/sec)
	4294967296 bytes transferred in 38.496 secs (111569183 bytes/sec)
	4294967296 bytes transferred in 38.595 secs (111282997 bytes/sec)

Revision 1.43: download - view: text, markup, annotated - select for diffs
Fri Jun 14 04:48:34 2019 UTC (5 years, 5 months ago) by mrg
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +4 -4 lines
in nvme_attach() when creating the admin queue to probe the device info,
and also in nvme_dmamem_alloc(), allow as many DMA segment as would be
maximally needed for the size, rather than hard coding '2' for the form
and '1' for the latter.

now ld@nvme on i386 doesn't crash and i see at least 1.3GB/sec.

Revision 1.39.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:07:11 2019 UTC (5 years, 6 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +110 -3 lines
Sync with HEAD

Revision 1.42: download - view: text, markup, annotated - select for diffs
Wed Apr 24 23:39:23 2019 UTC (5 years, 7 months ago) by mlelstv
Branches: MAIN
CVS tags: phil-wifi-20190609
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +5 -2 lines
Expose device type. You can query it with e.g. drvctl -p ld0 disk-info/type.

Revision 1.32.2.3: download - view: text, markup, annotated - select for diffs
Wed Dec 26 14:01:48 2018 UTC (5 years, 11 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.32.2.2: preferred, colored; branchpoint 1.32: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32.2.2: +107 -3 lines
Sync with HEAD, resolve a few conflicts

Revision 1.41: download - view: text, markup, annotated - select for diffs
Sat Dec 1 15:07:58 2018 UTC (6 years ago) by jdolecek
Branches: MAIN
CVS tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, isaki-audio2-base, isaki-audio2
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +101 -3 lines
support DIOCSCACHE + DKCACHE_WRITE if volatile write cache is present

fix the Get Features call for DIOCGCACHE to actually retrieve the current
value properly

Revision 1.40: download - view: text, markup, annotated - select for diffs
Sat Dec 1 08:03:44 2018 UTC (6 years ago) by jdolecek
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +8 -2 lines
disestablish the interrupt on failure in nvme_q_create()

Revision 1.32.2.2: download - view: text, markup, annotated - select for diffs
Sun Apr 22 07:20:20 2018 UTC (6 years, 7 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.32.2.1: preferred, colored; branchpoint 1.32: preferred, colored
Changes since revision 1.32.2.1: +63 -35 lines
Sync with HEAD

Revision 1.30.2.4: download - view: text, markup, annotated - select for diffs
Thu Apr 19 15:37:56 2018 UTC (6 years, 7 months ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Diff to: previous 1.30.2.3: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.2.3: +63 -35 lines
Pull up following revision(s) (requested by nonaka in ticket #781):

	sbin/nvmectl/Makefile				1.4
	sbin/nvmectl/bignum.c				1.2
	sbin/nvmectl/devlist.c				1.3-1.5
	sbin/nvmectl/firmware.c				1.3,1.4
	sbin/nvmectl/identify.c				1.3-1.5
	sbin/nvmectl/logpage.c				1.5-1.7
	sbin/nvmectl/nvme.h				1.3
	sbin/nvmectl/nvmectl.8				1.5
	sbin/nvmectl/nvmectl.c				1.5-1.7
	sbin/nvmectl/nvmectl.h				1.5-1.8
	sbin/nvmectl/perftest.c				1.3-1.5
	sbin/nvmectl/power.c				1.3,1.4
	sbin/nvmectl/reset.c				1.2,1.3
	sbin/nvmectl/util.c				1.1,1.2
	sbin/nvmectl/wdc.c				1.2-1.4
	sys/dev/ic/ld_nvme.c				1.20
	sys/dev/ic/nvme.c				1.38,1.39
	sys/dev/ic/nvmeio.h				1.2
	sys/dev/ic/nvmereg.h				1.10,1.11
	sys/dev/ic/nvmevar.h				1.16
	sys/dev/pci/nvme_pci.c				1.20

nvmectl(8): Sync with FreeBSD nvmecontrol(8) r328763.

nvmectl(8): fix wdc command usage.

nvme(4): Added some delay before check RDY bit quirk when disabling device.
Pick from FreeBSD nvme(4) r326937.

Add some new structure fileds, opcodes and statuses from NVMe 1.3a.

nvmectl(8): Add big-endian support.
from FreeBSD nvmecontolr(8) r329824.

nvmectl(8): fix subcommand usage.

nvmectl(8): Remove some wdc subcommands from man page.
- wdc drive-log
- wdc get-crash-dump
- wdc purge
- wdc purge-monitor

Typos.

use setprogname()/getprogname(), do not hardcode the prognam name in fixed
strings

Revision 1.39: download - view: text, markup, annotated - select for diffs
Wed Apr 18 10:11:45 2018 UTC (6 years, 7 months ago) by nonaka
Branches: MAIN
CVS tags: phil-wifi-base, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, jdolecek-ncqfixes-base, jdolecek-ncqfixes
Branch point for: phil-wifi
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +21 -16 lines
nvmectl(8): Add big-endian support.

from FreeBSD nvmecontolr(8) r329824.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Wed Apr 18 10:05:59 2018 UTC (6 years, 7 months ago) by nonaka
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +44 -21 lines
nvme(4): Added some delay before check RDY bit quirk when disabling device.

Pick from FreeBSD nvme(4) r326937.

Revision 1.30.2.3: download - view: text, markup, annotated - select for diffs
Mon Apr 9 13:23:29 2018 UTC (6 years, 8 months ago) by bouyer
Branches: netbsd-8
Diff to: previous 1.30.2.2: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.2.2: +6 -3 lines
Pull up following revision(s) (requested by msaitoh in ticket #718):
	sys/dev/ic/nvme.c: revision 1.32
- don't leak ccb on alloc failure.
- KASSERT to prevent memory leak.

Revision 1.32.2.1: download - view: text, markup, annotated - select for diffs
Thu Mar 22 01:44:48 2018 UTC (6 years, 8 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +202 -64 lines
Synch with HEAD, resolve conflicts

Revision 1.30.2.2: download - view: text, markup, annotated - select for diffs
Sun Mar 18 11:05:27 2018 UTC (6 years, 8 months ago) by martin
Branches: netbsd-8
Diff to: previous 1.30.2.1: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.2.1: +201 -53 lines
Pull up following revision(s) (requested by jdolecek in ticket #641):
	sys/dev/ic/nvme.c: revision 1.34
	sys/dev/ic/nvme.c: revision 1.35
	sys/dev/ic/nvme.c: revision 1.36
	sys/dev/ic/nvme.c: revision 1.37
	sys/dev/ic/ld_nvme.c: revision 1.19
	sys/dev/ic/nvmevar.h: revision 1.15

refactor the locking code around DIOCGCACHE handling to be reusable
for other infrequent commands,it uses single condvar for simplicity,
and uses it both when waiting for ccb or command completion - this
is fine, since usually there will be just one such command qeueued anyway
use this to finally properly implement DIOCCACHESYNC - return only after
the command is confirmed as completed by the controller.

switch handling of passthrough commands to use queue, instead of polling
should fix PR kern/53059 by Frank Kardel

fix passthrough command usage also in nvme_get_number_of_queues(), fixes
memory corruption and possible panic on boot

also remove now duplicate nvme_ccb_put() call from
nvme_get_number_of_queues()

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sat Mar 17 09:45:44 2018 UTC (6 years, 8 months ago) by jdolecek
Branches: MAIN
CVS tags: pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +2 -4 lines
also remove now duplicate nvme_ccb_put() call from nvme_get_number_of_queues()

Revision 1.36: download - view: text, markup, annotated - select for diffs
Sat Mar 17 09:36:32 2018 UTC (6 years, 8 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +8 -3 lines
fix passthrough command usage also in nvme_get_number_of_queues(), fixes
memory corruption and possible panic on boot

PR kern/53059

Revision 1.30.2.1: download - view: text, markup, annotated - select for diffs
Sat Mar 17 08:11:18 2018 UTC (6 years, 8 months ago) by martin
Branches: netbsd-8
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +4 -14 lines
Pull up following revision(s) (requested by jdolecek in ticket #636):
	sys/dev/ic/nvme.c: revision 1.33
	sys/dev/ic/nvmevar.h: revision 1.14
stop using q_nccbs_avail for deciding whether there are available ccbs;
no need to maintain a counter _and_ q_ccb_list
this fixes deadlock when all ccbs happen to be taken before completion
interrupt - nvme_q_complete() increased q_nccbs_avail only after
processing all the completed commands, by then there was nothing
left to actually kick the disk queue again into action
this also fixes ccb leak on command errors e.g. with bus_dmamem_alloc()
or bus_dmamel_load() - q_nccbs_avail was never decreased on the error path
fixes PR kern/52769 by Martin Husemann, thanks to Paul Goyette
for testing

Revision 1.35: download - view: text, markup, annotated - select for diffs
Sat Mar 17 00:28:03 2018 UTC (6 years, 8 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +37 -11 lines
switch handling of passthrough commands to use queue, instead of polling

should fix PR kern/53059 by Frank Kardel

Revision 1.34: download - view: text, markup, annotated - select for diffs
Fri Mar 16 23:31:19 2018 UTC (6 years, 8 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +160 -41 lines
refactor the locking code around DIOCGCACHE handling to be reusable
for other infrequent commands

it uses single condvar for simplicity, and uses it both when waiting
for ccb or command completion - this is fine, since usually there
will be just one such command qeueued anyway

use this to finally properly implement DIOCCACHESYNC - return only after
the command is confirmed as completed by the controller

Revision 1.33: download - view: text, markup, annotated - select for diffs
Fri Mar 16 18:49:18 2018 UTC (6 years, 8 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +4 -14 lines
stop using q_nccbs_avail for deciding whether there are available ccbs;
no need to maintain a counter _and_ q_ccb_list

this fixes deadlock when all ccbs happen to be taken before completion
interrupt - nvme_q_complete() increased q_nccbs_avail only after
processing all the completed commands, by then there was nothing
left to actually kick the disk queue again into action

this also fixes ccb leak on command errors e.g. with bus_dmamem_alloc()
or bus_dmamel_load() - q_nccbs_avail was never decreased on the error path

fixes PR kern/52769 by Martin Husemann, thanks to Paul Goyette
for testing

Revision 1.32: download - view: text, markup, annotated - select for diffs
Tue Feb 27 12:59:53 2018 UTC (6 years, 9 months ago) by christos
Branches: MAIN
CVS tags: pgoyette-compat-base, pgoyette-compat-0315
Branch point for: pgoyette-compat
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +6 -3 lines
- don't leak ccb on alloc failure.
- KASSERT to prevent memory leak.

Revision 1.31.2.2: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:37:03 2017 UTC (7 years ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.31.2.1: preferred, colored; branchpoint 1.31: preferred, colored; next MAIN 1.32: preferred, colored
Changes since revision 1.31.2.1: +1752 -0 lines
update from HEAD

Revision 1.31.2.1
Sat Oct 28 04:53:55 2017 UTC (7 years, 1 month ago) by jdolecek
Branches: tls-maxphys
FILE REMOVED
Changes since revision 1.31: +0 -1752 lines
file nvme.c was added on branch tls-maxphys on 2017-12-03 11:37:03 +0000

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sat Oct 28 04:53:55 2017 UTC (7 years, 1 month ago) by riastradh
Branches: MAIN
CVS tags: tls-maxphys-base-20171202
Branch point for: tls-maxphys
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +4 -4 lines
Kill some more extern struct cfdriver declarations.

Down with externs in .c!

Revision 1.2.2.6: download - view: text, markup, annotated - select for diffs
Mon Aug 28 17:52:03 2017 UTC (7 years, 3 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.2.2.5: preferred, colored; branchpoint 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.2.5: +127 -55 lines
Sync with HEAD

Revision 1.30: download - view: text, markup, annotated - select for diffs
Thu Jun 1 02:45:10 2017 UTC (7 years, 6 months ago) by chs
Branches: MAIN
CVS tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek
Branch point for: netbsd-8
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +2 -18 lines
remove checks for failure after memory allocation calls that cannot fail:

  kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Mon May 29 02:25:37 2017 UTC (7 years, 6 months ago) by nonaka
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +2 -3 lines
nvme(4): Don't set prp1 for DEL_IOCQ

> NVM_ADMIN_DEL_IOCQ does not need prp1 (just as NVM_ADMIN_DEL_IOSQ).
> Remove what is likely a cut'n'paste error from the *_ADD_* code.

from OpenBSD nvme.c r1.56.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon May 29 02:24:00 2017 UTC (7 years, 6 months ago) by nonaka
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +6 -9 lines
nvme(4): Do not use bus_space_{read,write}_8() even on LP64 archs.

> some (broken) controllers require ordered split transfers.
> From linux a310acd7a7ea53533886c11bb7edd11ffd61a036

from OpenBSD nvme.c r1.53.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon May 29 02:20:34 2017 UTC (7 years, 6 months ago) by nonaka
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +8 -30 lines
nvme(4): Mask non relevant bits when pritting version number.

from OpenBSD nvme.c r1.52.

Revision 1.26.4.1: download - view: text, markup, annotated - select for diffs
Sun Apr 30 10:27:16 2017 UTC (7 years, 7 months ago) by pgoyette
Branches: prg-localcount2
Diff to: previous 1.26: preferred, colored; next MAIN 1.27: preferred, colored
Changes since revision 1.26: +3 -2 lines
And a few more DEVSW_MODULE_INIT for modular drivers

Revision 1.3.2.3: download - view: text, markup, annotated - select for diffs
Wed Apr 26 02:53:11 2017 UTC (7 years, 7 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.3.2.2: preferred, colored; branchpoint 1.3: preferred, colored; next MAIN 1.4: preferred, colored
Changes since revision 1.3.2.2: +5 -2 lines
Sync with HEAD

Revision 1.22.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 21 16:53:46 2017 UTC (7 years, 7 months ago) by bouyer
Branches: bouyer-socketcan
Diff to: previous 1.22: preferred, colored; next MAIN 1.23: preferred, colored
Changes since revision 1.22: +120 -6 lines
Sync with HEAD

Revision 1.26: download - view: text, markup, annotated - select for diffs
Wed Apr 5 20:15:49 2017 UTC (7 years, 8 months ago) by jdolecek
Branches: MAIN
CVS tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, pgoyette-localcount-20170426, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: prg-localcount2
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +5 -2 lines
expose disk device FUA/DPO support via DIOCGCACHE, and allow the flags
to be set for I/O; implement support in sd(4) and nvme(4)

discussed on tech-kern

Revision 1.3.2.2: download - view: text, markup, annotated - select for diffs
Mon Mar 20 06:57:28 2017 UTC (7 years, 8 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.3.2.1: preferred, colored; branchpoint 1.3: preferred, colored
Changes since revision 1.3.2.1: +117 -6 lines
Sync with HEAD

Revision 1.25: download - view: text, markup, annotated - select for diffs
Tue Feb 28 20:53:50 2017 UTC (7 years, 9 months ago) by jdolecek
Branches: MAIN
CVS tags: pgoyette-localcount-20170320
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +65 -5 lines
implement DIOCGCACHE

Revision 1.24: download - view: text, markup, annotated - select for diffs
Mon Feb 13 11:11:32 2017 UTC (7 years, 9 months ago) by nonaka
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +5 -2 lines
NVMe 1.2.1

Revision 1.23: download - view: text, markup, annotated - select for diffs
Mon Feb 13 11:10:45 2017 UTC (7 years, 9 months ago) by nonaka
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +52 -4 lines
nvme(4): Limit the number of queues to the number allocated in HW.

Revision 1.2.2.5: download - view: text, markup, annotated - select for diffs
Mon Dec 5 10:55:01 2016 UTC (8 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.2.2.4: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.2.4: +149 -78 lines
Sync with HEAD

Revision 1.3.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 4 14:49:09 2016 UTC (8 years, 1 month ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +292 -157 lines
Sync with HEAD

Revision 1.22: download - view: text, markup, annotated - select for diffs
Tue Nov 1 14:46:31 2016 UTC (8 years, 1 month ago) by jdolecek
Branches: MAIN
CVS tags: pgoyette-localcount-20170107, pgoyette-localcount-20161104, nick-nhusb-base-20170204, nick-nhusb-base-20161204, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +3 -3 lines
reduce admin queue size to save memory; it's only ever used during
attach/detach and for nvmectl(8), so there is actually no point having it big

Revision 1.21: download - view: text, markup, annotated - select for diffs
Tue Nov 1 14:39:38 2016 UTC (8 years, 1 month ago) by jdolecek
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +4 -3 lines
pass maxphys from device rather then assuming MAXPHYS; it's clipped in ld(4)
if bigger then MAXPHYS

multiply the queue size by number of queues for ld(4) sc_maxqueuecnt, so
that ld_diskstart() would try to use full capacity, instead of throttling
to one queue worth of commands

Revision 1.20: download - view: text, markup, annotated - select for diffs
Tue Nov 1 14:24:35 2016 UTC (8 years, 1 month ago) by jdolecek
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +27 -11 lines
tighter queue control - according to spec actual cap on number of commands
in flight is actually one less then queue size, head == tail means empty
queue

Revision 1.19: download - view: text, markup, annotated - select for diffs
Thu Oct 20 19:20:40 2016 UTC (8 years, 1 month ago) by jdolecek
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +60 -55 lines
revert change from rev. 1.12:
"""
slightly optimize memory access - change struct nvme_queue so that the
struct dmamem members are allocated as part of it, instead of separate
kmem_alloc()s
"""

that change quite curiously caused completion queue corruption on MP systems,
regardless of MPSAFE setting for the pci/softintr interrupt

Revision 1.18: download - view: text, markup, annotated - select for diffs
Wed Oct 19 19:34:31 2016 UTC (8 years, 1 month ago) by jdolecek
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +22 -3 lines
add debug code to check for completion queue corruption

Revision 1.17: download - view: text, markup, annotated - select for diffs
Wed Oct 19 19:31:23 2016 UTC (8 years, 1 month ago) by jdolecek
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +31 -9 lines
follow advice of spec and block interrupts via INTMS/INTMC for intx handler;
this also makes it possible to offload the actual interrupt processing to softintr
handler, similar as for MSI/MSI-X

Revision 1.16: download - view: text, markup, annotated - select for diffs
Tue Oct 18 07:48:05 2016 UTC (8 years, 1 month ago) by nonaka
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +6 -6 lines
fix a sync range size when number of bus_dma segment is greater than 2.

Revision 1.2.2.4: download - view: text, markup, annotated - select for diffs
Wed Oct 5 20:55:41 2016 UTC (8 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.2.2.3: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.2.3: +290 -299 lines
Sync with HEAD

Revision 1.15: download - view: text, markup, annotated - select for diffs
Wed Oct 5 03:46:38 2016 UTC (8 years, 2 months ago) by nonaka
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +12 -4 lines
The maximum number of IO queue entries is hardware supported value.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Tue Sep 27 03:33:32 2016 UTC (8 years, 2 months ago) by pgoyette
Branches: MAIN
CVS tags: nick-nhusb-base-20161004
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +22 -10 lines
Modularize the ld driver and all of its attachments.  Ensure that all
parents are capable of rescan (or otherwise provide a means of attaching
children post-initialization).

Revision 1.13: download - view: text, markup, annotated - select for diffs
Tue Sep 20 21:18:08 2016 UTC (8 years, 2 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +3 -3 lines
cache flush call must wait for completion; cap wait to 60 seconds just in case
controller won't respond

Revision 1.12: download - view: text, markup, annotated - select for diffs
Mon Sep 19 22:11:41 2016 UTC (8 years, 2 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +54 -58 lines
slightly optimize memory access - change struct nvme_queue so that the
struct dmamem members are allocated as part of it, instead of separate
kmem_alloc()s

Revision 1.11: download - view: text, markup, annotated - select for diffs
Mon Sep 19 20:33:51 2016 UTC (8 years, 2 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +48 -48 lines
on further thought, just remove the separately allocated nvme_ns_context
altogether and fold into nvme_ccb; allocating this separately just isn't useful

Revision 1.10: download - view: text, markup, annotated - select for diffs
Mon Sep 19 19:06:57 2016 UTC (8 years, 2 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +7 -5 lines
comment tyop and KNF; pointed out by Nick

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sun Sep 18 21:19:39 2016 UTC (8 years, 2 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +58 -53 lines
fix several bugs, make nvme(4) MPSAFE by default and also bump default
number of ioq from 128 to 1024; tested with VirtualBox and QEMU

* remove NVME_INTMC/NVME_INTMS writes in hw intr handler as this is not MPSAFE,
  fortunately they don't seem to be necessary; shaves two register writes
* need to use full mutex_enter() in nvme_q_complete(), to avoid small
  race between one handler exiting the loop and another entering
* for MSI, handover the command result processing to softintr; unfortunately
  can't easily do that for INTx interrupts as they require doorbell write
  to deassert
* unlock/relock q->q_cq_mtx before calling ccb_done to avoid potential deadlocks
* make sure to destroy queue mutexes when destroying the queue (LOCKDEBUG)
* make ns ctx pool per-device, so that it's deallocated properly on module
  unload
* handle ctx allocation failure in ld_nvme_dobio()
* remove splbio() calls in ld_nvme_dobio() and sync, the paths are exercised
  only for dump/shutdown, and that already disables interrupts
* free the ns ctx in ld_nvme_biodone() before calling lddone() to avoid
  memory starvation, as lddone() can trigger another i/o request
* be more careful with using PR_WAITOK, the paths are called from interrupt
  context and there we can't wait

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sat Sep 17 19:52:16 2016 UTC (8 years, 2 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +64 -32 lines
make nvme_dumpregs() compile on LP64 hosts

sprinkle some delays() and extra checks into attach code, so that it follows
more closely what FreeBSD driver does, and is easier to cross-check

Revision 1.7: download - view: text, markup, annotated - select for diffs
Fri Sep 16 12:57:26 2016 UTC (8 years, 2 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +37 -20 lines
introduce optional timeout for the polled commands; currently 5 seconds for
queue creation/deletion, 10 seconds for controller/namespace identify,
and unlimited for cache sync and passthrough commands

this makes device attach error out instead of hanging the kernel when
the device fails to respond properly, such as under QEMU currently

Revision 1.6: download - view: text, markup, annotated - select for diffs
Fri Sep 16 11:41:40 2016 UTC (8 years, 2 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +5 -5 lines
make nvme_dumpregs() compile when NVME_DEBUG is defined

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Sep 8 15:00:08 2016 UTC (8 years, 3 months ago) by nonaka
Branches: MAIN
CVS tags: localcount-20160914
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +32 -105 lines
Fix to cannnot be opened a nvme(4) namespace device file.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Thu Sep 8 04:41:16 2016 UTC (8 years, 3 months ago) by nonaka
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +4 -4 lines
fix off-by-one error in namespace id range check.

Revision 1.2.2.3: download - view: text, markup, annotated - select for diffs
Sat Jul 9 20:25:02 2016 UTC (8 years, 5 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.2.2.2: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.2.2: +329 -2 lines
Sync with HEAD

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat Jun 4 16:11:51 2016 UTC (8 years, 6 months ago) by nonaka
Branches: MAIN
CVS tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20160907
Branch point for: pgoyette-localcount
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +329 -2 lines
Add NVMe command passthrough support.

Revision 1.2.2.2: download - view: text, markup, annotated - select for diffs
Sun May 29 08:44:21 2016 UTC (8 years, 6 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.2.2.1: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.2.1: +1291 -0 lines
Sync with HEAD

Revision 1.2.2.1
Mon May 2 19:18:29 2016 UTC (8 years, 7 months ago) by skrll
Branches: nick-nhusb
FILE REMOVED
Changes since revision 1.2: +0 -1291 lines
file nvme.c was added on branch nick-nhusb on 2016-05-29 08:44:21 +0000

Revision 1.2: download - view: text, markup, annotated - select for diffs
Mon May 2 19:18:29 2016 UTC (8 years, 7 months ago) by christos
Branches: MAIN
CVS tags: nick-nhusb-base-20160529
Branch point for: nick-nhusb
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +8 -50 lines
move scsipi_strvis -> libkern:strnvisx()
change the prototype to match userland
fix sizes of strings passed to it

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sun May 1 10:21:02 2016 UTC (8 years, 7 months ago) by nonaka
Branches: MAIN
Added nvme(4) for Non-Volatile Memory Host Controller Interface devices.
Ported from OpenBSD.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>