The NetBSD Project

CVS log for src/sys/dev/pci/vioscsi.c

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.30.2.1 / (download) - annotate - [select for diffs], Sat May 13 10:56:10 2023 UTC (9 months, 2 weeks ago) by martin
Branch: netbsd-10
CVS Tags: netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1
Changes since 1.30: +11 -8 lines
Diff to previous 1.30 (colored) next main 1.31 (colored)

Pull up following revision(s) (requested by yamaguchi in ticket #139):

	sys/dev/pci/vioscsi.c: revision 1.31
	sys/dev/pci/vio9p.c: revision 1.10
	sys/dev/pci/vioscsi.c: revision 1.32
	sys/dev/pci/vio9p.c: revision 1.11
	sys/dev/pci/vioscsi.c: revision 1.33
	sys/dev/pci/ld_virtio.c: revision 1.31
	sys/dev/virtio/viocon.c: revision 1.6
	sys/dev/pci/vioscsi.c: revision 1.34
	sys/dev/pci/ld_virtio.c: revision 1.32
	sys/dev/virtio/viocon.c: revision 1.7
	sys/dev/virtio/viocon.c: revision 1.8
	sys/dev/pci/vioscsi.c: revision 1.36
	sys/dev/pci/virtioreg.h: revision 1.12
	sys/dev/pci/viornd.c: revision 1.19
	sys/dev/pci/virtio.c: revision 1.66
	sys/dev/pci/virtio.c: revision 1.67
	sys/dev/pci/virtio.c: revision 1.68
	sys/dev/pci/if_vioif.c: revision 1.103
	sys/dev/pci/virtio.c: revision 1.69
	sys/dev/pci/if_vioif.c: revision 1.104
	sys/dev/pci/virtio_pci.c: revision 1.40
	sys/dev/virtio/virtio_mmio.c: revision 1.8
	sys/dev/virtio/virtio_mmio.c: revision 1.9
	sys/dev/pci/viomb.c: revision 1.14
	sys/dev/pci/viomb.c: revision 1.15
	sys/dev/pci/viomb.c: revision 1.17
	sys/dev/pci/viornd.c: revision 1.20
	sys/dev/pci/viornd.c: revision 1.21
	sys/dev/pci/virtiovar.h: revision 1.25
	sys/dev/pci/virtiovar.h: revision 1.26
	sys/dev/pci/virtiovar.h: revision 1.27
	sys/dev/pci/virtiovar.h: revision 1.28
	sys/dev/pci/virtio.c: revision 1.70
	sys/dev/pci/virtio.c: revision 1.71
	sys/dev/pci/virtio.c: revision 1.72
	sys/dev/pci/virtio.c: revision 1.73
	sys/dev/pci/virtio.c: revision 1.74
	sys/dev/pci/virtio_pci.c: revision 1.39

Set virtqueues in virtio_child_attach_finish

The number of virtqueue maybe change in a part of VirtIO devices
(e.g. vioif(4)). And it is fixed after negotiation of features.
So the configuration is moved into the function.

viocon(4): fix not to allocate unused virtqueue

viocon(4) allocates 4 virtqueues but it only uses 2 (0 and 1) queues.

Added functions to set interrupt handler and index into virtqueue

Added check of pointer for allocated memory before release of resource

Setup virtqueues after registering them to virtio_softc
restore fetch of qsize.

Mark as MPSAFE.

virtio(4): Avoid name collision with global intrhand on sparc64.

Pacifies -Werror=shadow.
No functional change intended.

Use PRIuBUSSIZE to print bus_size_t variables.

virtio(4): Fix sizing of virtqueue allocation.
vq->vq_avail[0].ring is a zero-length array, and thus sizeof is zero;
likewise vq->vq_used[0].ring.
Use vq->vq_avail[0].ring[0] and vq->vq_used[0].ring[0] to fix this
and restore the previous allocation sizing logic.
XXX We shouldn't use zero-length arrays here -- they are asking for
trouble like this, and C99 has a standard way to express what we're
actually trying to get at it, flexible array members.
PR kern/57304

virtio(4): Use flexible array members, not zero-length arrays.
This enables the compiler to detect sizeof mistakes like
PR kern/57304.

Use descriptor chain for free slots instead of vq_entry list
Descriptors can be chained by themself. And descriptors added to
avail ring or used ring are already chained. But it was not used
for unused descriptors and another linked list structure named
vq_entry was used.

The chain is also used for unused descriptors to make virtio(4)
simpler.

Added flags to store status of attaching a virtio device

This prevents a panic on reboot after a virtio device had called
virtio_child_attach_failed().

Fix wrong variable names
This fixes build errors in virtio_mmio.c

Revision 1.36 / (download) - annotate - [select for diffs], Sat Mar 25 11:04:34 2023 UTC (11 months ago) by mlelstv
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, HEAD
Changes since 1.35: +5 -3 lines
Diff to previous 1.35 (colored)

Mark as MPSAFE.

Revision 1.35 / (download) - annotate - [select for diffs], Sat Mar 25 09:03:47 2023 UTC (11 months ago) by mlelstv
Branch: MAIN
Changes since 1.34: +4 -6 lines
Diff to previous 1.34 (colored)

A single SCSI request may require multiple slots in the virtio queue
but the queue isn't sized for the theoretical maximum. So just use
XS_BUSY to pace the scsipi layer.

Revision 1.34 / (download) - annotate - [select for diffs], Sat Mar 25 08:14:00 2023 UTC (11 months ago) by mlelstv
Branch: MAIN
Changes since 1.33: +3 -2 lines
Diff to previous 1.33 (colored)

restore fetch of qsize.

Revision 1.33 / (download) - annotate - [select for diffs], Fri Mar 24 13:32:19 2023 UTC (11 months ago) by yamaguchi
Branch: MAIN
Changes since 1.32: +3 -4 lines
Diff to previous 1.32 (colored)

Added check of pointer for allocated memory before release of resource

Revision 1.32 / (download) - annotate - [select for diffs], Thu Mar 23 03:55:11 2023 UTC (11 months ago) by yamaguchi
Branch: MAIN
Changes since 1.31: +6 -6 lines
Diff to previous 1.31 (colored)

Added functions to set interrupt handler and index into virtqueue

Revision 1.31 / (download) - annotate - [select for diffs], Thu Mar 23 03:27:48 2023 UTC (11 months, 1 week ago) by yamaguchi
Branch: MAIN
Changes since 1.30: +6 -5 lines
Diff to previous 1.30 (colored)

Set virtqueues in virtio_child_attach_finish

The number of virtqueue maybe change in a part of VirtIO devices
(e.g. vioif(4)). And it is fixed after negotiation of features.
So the configuration is moved into the function.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Oct 11 22:03:37 2022 UTC (16 months, 2 weeks ago) by andvar
Branch: MAIN
CVS Tags: netbsd-10-base
Branch point for: netbsd-10
Changes since 1.29: +4 -4 lines
Diff to previous 1.29 (colored)

fix typos in log messages s/bus_dmamem_create/bus_dmamap_create/ and
s/bus_dmamem_load/bus_dmamap_load/.
Inspired by recent similar fixes in OpenBSD.

Revision 1.29 / (download) - annotate - [select for diffs], Thu Jan 27 18:38:07 2022 UTC (2 years, 1 month ago) by jakllsch
Branch: MAIN
CVS Tags: bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.28: +5 -20 lines
Diff to previous 1.28 (colored)

We no need for PQUIRK_FORCELUNS now that we try REPORT LUNS.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Nov 12 07:18:53 2021 UTC (2 years, 3 months ago) by skrll
Branch: MAIN
Changes since 1.27: +7 -7 lines
Diff to previous 1.27 (colored)

Trailing whitespace

Revision 1.27 / (download) - annotate - [select for diffs], Sat Aug 7 16:19:14 2021 UTC (2 years, 6 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

Merge thorpej-cfargs2.

Revision 1.26.8.1 / (download) - annotate - [select for diffs], Wed Aug 4 21:27:00 2021 UTC (2 years, 6 months ago) by thorpej
Branch: thorpej-cfargs2
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored) next main 1.27 (colored)

Adapt to CFARGS().

Revision 1.26 / (download) - annotate - [select for diffs], Sat Apr 24 23:36:57 2021 UTC (2 years, 10 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-cfargs2
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

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.24.2.1 / (download) - annotate - [select for diffs], Sat Apr 3 22:28:49 2021 UTC (2 years, 10 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.24: +11 -9 lines
Diff to previous 1.24 (colored) next main 1.25 (colored)

Sync with HEAD.

Revision 1.25.2.1 / (download) - annotate - [select for diffs], Sun Mar 21 21:09:14 2021 UTC (2 years, 11 months ago) by thorpej
Branch: thorpej-cfargs
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored) next main 1.26 (colored)

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.25 / (download) - annotate - [select for diffs], Wed Jan 20 19:46:48 2021 UTC (3 years, 1 month ago) by reinoud
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-cfargs-base
Branch point for: thorpej-cfargs
Changes since 1.24: +11 -9 lines
Diff to previous 1.24 (colored)

Add VirtIO PCI v1.0 attachments and fix the drivers affected.

The vioif, ld, scsi, viornd and viomb devices were adjusted when needed and
tested both in legacy 0.9 and v1.0 attachments trough PCI on amd64, sparc64,
aarch64 and aarch64-eb. ACPI/FDT attachments also tested on
aarch64/aarch64-eb.

Known issues

* viomb on aarch64 works only with ACPI/FDT attachment but not with PCI
  attachment. PCI and ACPI/FDT attachment works on aarch64-eb.

* virtio on sparc64 attaches but is it not functioning though not a
  regression.

Revision 1.24 / (download) - annotate - [select for diffs], Sat Sep 19 07:30:32 2020 UTC (3 years, 5 months ago) by kim
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.23: +12 -4 lines
Diff to previous 1.23 (colored)

Update the Proxmox comment with link to their bugzilla

Revision 1.23 / (download) - annotate - [select for diffs], Fri Sep 18 14:55:28 2020 UTC (3 years, 5 months ago) by jakllsch
Branch: MAIN
Changes since 1.22: +9 -2 lines
Diff to previous 1.22 (colored)

Probe all LUNs on vioscsi(4) until scsi(4) can do REPORT LUNS.

Revision 1.19.2.2 / (download) - annotate - [select for diffs], Mon Jul 13 14:13:12 2020 UTC (3 years, 7 months ago) by martin
Branch: netbsd-8
Changes since 1.19.2.1: +4 -4 lines
Diff to previous 1.19.2.1 (colored) to branchpoint 1.19 (colored) next main 1.20 (colored)

Pull up following revision(s) (requested by kim in ticket #1572):

	sys/dev/pci/vioscsi.c: revision 1.22

Fix off-by-one SCSI target reporting

Use max_target as the controller ID instead of zero, so that the device
located at SCSI ID zero (e.g. a disk) is not obscured through not being
probed by scsi_probe_bus() (which skips the controller ID).

Copy the target requested onto the wire without decrementing it by one.

ok christos@

Revision 1.21.4.1 / (download) - annotate - [select for diffs], Mon Jul 13 14:11:55 2020 UTC (3 years, 7 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE
Changes since 1.21: +4 -4 lines
Diff to previous 1.21 (colored) next main 1.22 (colored)

Pull up following revision(s) (requested by kim in ticket #1001):

	sys/dev/pci/vioscsi.c: revision 1.22

Fix off-by-one SCSI target reporting

Use max_target as the controller ID instead of zero, so that the device
located at SCSI ID zero (e.g. a disk) is not obscured through not being
probed by scsi_probe_bus() (which skips the controller ID).

Copy the target requested onto the wire without decrementing it by one.

ok christos@

Revision 1.22 / (download) - annotate - [select for diffs], Sun Jul 12 06:40:11 2020 UTC (3 years, 7 months ago) by kim
Branch: MAIN
Changes since 1.21: +4 -4 lines
Diff to previous 1.21 (colored)

Fix off-by-one SCSI target reporting

Use max_target as the controller ID instead of zero, so that the device
located at SCSI ID zero (e.g. a disk) is not obscured through not being
probed by scsi_probe_bus() (which skips the controller ID).

Copy the target requested onto the wire without decrementing it by one.

ok christos@

Revision 1.19.2.1 / (download) - annotate - [select for diffs], Mon Jul 15 08:23:23 2019 UTC (4 years, 7 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE
Changes since 1.19: +5 -3 lines
Diff to previous 1.19 (colored)

Pull up following revision(s) (requested by maxv in ticket #1289):

	sys/dev/pci/vioscsi.c: revision 1.21

Fix use-after-free. If we're not polling, virtio_enqueue_commit() will send
the transaction, and it means 'xs' can be immediately freed. So, save the
value of xs_control beforehand.

Detected by KASAN, ok jdolecek@.
Fixes PR/54008

Revision 1.20.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:07:27 2019 UTC (4 years, 8 months ago) by christos
Branch: phil-wifi
Changes since 1.20: +5 -3 lines
Diff to previous 1.20 (colored) next main 1.21 (colored)

Sync with HEAD

Revision 1.21 / (download) - annotate - [select for diffs], Sat Apr 13 06:17:33 2019 UTC (4 years, 10 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, isaki-audio2-base, isaki-audio2, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Branch point for: netbsd-9
Changes since 1.20: +5 -3 lines
Diff to previous 1.20 (colored)

Fix use-after-free. If we're not polling, virtio_enqueue_commit() will send
the transaction, and it means 'xs' can be immediately freed. So, save the
value of xs_control beforehand.

Detected by KASAN, ok jdolecek@.

Fixes PR/54008
Reported-by: syzbot+6513c4afe66237d7207f@syzkaller.appspotmail.com

Revision 1.19.10.1 / (download) - annotate - [select for diffs], Mon Jun 25 07:26:01 2018 UTC (5 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.19: +2 -6 lines
Diff to previous 1.19 (colored) next main 1.20 (colored)

Sync with HEAD

Revision 1.20 / (download) - annotate - [select for diffs], Sun Jun 10 14:59:23 2018 UTC (5 years, 8 months ago) by jakllsch
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, jdolecek-ncqfixes-base, jdolecek-ncqfixes
Branch point for: phil-wifi
Changes since 1.19: +2 -6 lines
Diff to previous 1.19 (colored)

remove irrelevant pci(9) #includes from virtio child drivers

Revision 1.19.8.2 / (download) - annotate - [select for diffs], Sun Dec 3 11:37:29 2017 UTC (6 years, 2 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.19.8.1: +718 -0 lines
Diff to previous 1.19.8.1 (colored) to branchpoint 1.19 (colored) next main 1.20 (colored)

update from HEAD

Revision 1.6.2.4 / (download) - annotate - [select for diffs], Mon Aug 28 17:52:25 2017 UTC (6 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.6.2.3: +317 -158 lines
Diff to previous 1.6.2.3 (colored) to branchpoint 1.6 (colored) next main 1.7 (colored)

Sync with HEAD

Revision 1.16.4.1 / (download) - annotate - [select for diffs], Fri May 19 00:22:57 2017 UTC (6 years, 9 months ago) by pgoyette
Branch: prg-localcount2
Changes since 1.16: +29 -23 lines
Diff to previous 1.16 (colored) next main 1.17 (colored)

Resolve conflicts from previous merge (all resulting from $NetBSD
keywork expansion)

Revision 1.19.8.1, Mon May 15 21:30:37 2017 UTC (6 years, 9 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.19: +0 -718 lines
FILE REMOVED

file vioscsi.c was added on branch tls-maxphys on 2017-12-03 11:37:29 +0000

Revision 1.19 / (download) - annotate - [select for diffs], Mon May 15 21:30:37 2017 UTC (6 years, 9 months ago) by jdolecek
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, prg-localcount2-base3, pgoyette-compat-base, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek
Branch point for: tls-maxphys, pgoyette-compat, netbsd-8
Changes since 1.18: +7 -7 lines
Diff to previous 1.18 (colored)

free the virtio slot _before_ calling scsipi_done(), so that driver is able
to accept another request immediatelly and doesn't trigger spurious
XS_RESOURCE_SHORTAGE

part of fix for PR kern/52199

Revision 1.18 / (download) - annotate - [select for diffs], Sat May 13 20:35:20 2017 UTC (6 years, 9 months ago) by jdolecek
Branch: MAIN
Changes since 1.17: +23 -17 lines
Diff to previous 1.17 (colored)

refactor error handling in vioscsi_scsipi_request() to avoid the goto maze,
and add missing virtio_enqueue_abort() call when bus_dmamap_load() fails;
abort is only done implicitely when virtio_enqueue_reserve() fails,
must do it explicitely if there is other reason

also now always print error when bus_dmamap_load() or virtio_enqueue_reserve()
fail - the former shouldn't fail due to BUS_DMA_ALLOCNOW, and the latter
shouldn't ever fail now after the maxnsegs fix for virtio_alloc_vq(), so
error there means driver bug

Revision 1.17 / (download) - annotate - [select for diffs], Sat May 13 20:17:42 2017 UTC (6 years, 9 months ago) by jdolecek
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

fix number of maximum segments in the queue allocation so that
MAXPHYS-sized tranfer fits inside the indirect descriptor; avoids the
!indirect path in virtio_enqueue_reserve() for these transfers,
which runs out of the vq_entries and triggers XS_RESOURCE_SHORTAGE for
bigger number of outstanding tranfers

fixes PR kern/52199 by MB

Revision 1.6.4.3 / (download) - annotate - [select for diffs], Wed Apr 26 02:53:22 2017 UTC (6 years, 10 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.6.4.2: +213 -89 lines
Diff to previous 1.6.4.2 (colored) to branchpoint 1.6 (colored) next main 1.7 (colored)

Sync with HEAD

Revision 1.8.4.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:53:51 2017 UTC (6 years, 10 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.8: +295 -142 lines
Diff to previous 1.8 (colored) next main 1.9 (colored)

Sync with HEAD

Revision 1.16 / (download) - annotate - [select for diffs], Sat Mar 25 23:58:35 2017 UTC (6 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: 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
Changes since 1.15: +4 -4 lines
Diff to previous 1.15 (colored)

fix printf format.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Mar 25 18:15:31 2017 UTC (6 years, 11 months ago) by jdolecek
Branch: MAIN
Changes since 1.14: +133 -40 lines
Diff to previous 1.14 (colored)

add support for loading vioscsi driver dynamically

Revision 1.14 / (download) - annotate - [select for diffs], Sat Mar 25 18:13:53 2017 UTC (6 years, 11 months ago) by jdolecek
Branch: MAIN
Changes since 1.13: +3 -6 lines
Diff to previous 1.13 (colored)

cap also adapt_nchannels to 1, we only attach one

Revision 1.13 / (download) - annotate - [select for diffs], Sat Mar 25 18:09:44 2017 UTC (6 years, 11 months ago) by jdolecek
Branch: MAIN
Changes since 1.12: +5 -5 lines
Diff to previous 1.12 (colored)

cap adapt_openings to minimum of cmd_per_lun and qsize, so that we don't
overpromise to the upper layer

cap ntargets and nluns to 16 and 1024 as avoid spending excessive time
probing for nonexistent devices; e.g. qemu defaults to 255/16383 causing
the probe to take about a minute

Revision 1.12 / (download) - annotate - [select for diffs], Sat Mar 25 18:02:06 2017 UTC (6 years, 11 months ago) by jdolecek
Branch: MAIN
Changes since 1.11: +83 -49 lines
Diff to previous 1.11 (colored)

reorganize the attachment process for virtio child devices, so that
more common code is shared among the drivers, and it's possible for
the drivers to be correctly dynamically loaded; forbid direct access
to struct virtio_softc from the child driver code

Revision 1.6.4.2 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:37 2017 UTC (6 years, 11 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.6.4.1: +103 -74 lines
Diff to previous 1.6.4.1 (colored) to branchpoint 1.6 (colored)

Sync with HEAD

Revision 1.11 / (download) - annotate - [select for diffs], Mon Mar 13 21:06:50 2017 UTC (6 years, 11 months ago) by jdolecek
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320
Changes since 1.10: +21 -30 lines
Diff to previous 1.10 (colored)

several small tweaks:
- use MSIX if available
- fix off-by-one for nluns/ntargets (code inspection, not actual effect)
- when virtio_enqueue_reserve() fails, do not execute vioscsi_req_put()
  and hence virtio_dequeue_commit() as there is nothing to commit, just
  unload the xs and return; also report XS_RESOURCE_SHORTAGE, it's
  semi-normal situation
- set status/resid in vioscsi_req_done() before the switch, so that
  the override for VIRTIO_SCSI_S_BAD_TARGET actually has effect
- g/c vioscsi_req_put(), call the appropriate cleanup routines directly
- stop initializing id/task_attr in vioscsi_req_get(), it's overwritten
  in vioscsi_scsipi_request() anyway

Revision 1.10 / (download) - annotate - [select for diffs], Mon Mar 13 20:47:38 2017 UTC (6 years, 11 months ago) by jdolecek
Branch: MAIN
Changes since 1.9: +17 -9 lines
Diff to previous 1.9 (colored)

replace req queue offset with define, only set & start the req interrupt for
that queue; add some masks for the lun for visibility; use slot as tag number

no actual functional change, just small cleanup

Revision 1.9 / (download) - annotate - [select for diffs], Tue Mar 7 22:03:04 2017 UTC (6 years, 11 months ago) by jdolecek
Branch: MAIN
Changes since 1.8: +70 -40 lines
Diff to previous 1.8 (colored)

allocate bus dma maps during attachment, rather than creating and destroying
them for each request; besides being faster, bus_dmamap_destroy() is not
safe to be called from interrupt context

adresses PR kern/52034 by Benny Siegert

Revision 1.8.6.2 / (download) - annotate - [select for diffs], Wed Jan 18 08:46:42 2017 UTC (7 years, 1 month ago) by skrll
Branch: netbsd-7-nhusb
Changes since 1.8.6.1: +559 -0 lines
Diff to previous 1.8.6.1 (colored) to branchpoint 1.8 (colored) next main 1.9 (colored)

Sync with netbsd-5

Revision 1.8.2.2 / (download) - annotate - [select for diffs], Fri Dec 23 06:33:56 2016 UTC (7 years, 2 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base-20170116, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1
Changes since 1.8.2.1: +559 -0 lines
Diff to previous 1.8.2.1 (colored) to branchpoint 1.8 (colored) next main 1.9 (colored)

Pull up following revision(s) (requested by bsiegert in ticket #1338):
	sys/arch/amd64/conf/GENERIC: revision 1.418
	sys/dev/pci/files.pci: revision 1.379
	sys/dev/pci/vioscsi.c: revisions 1.1-1.8
	sys/dev/pci/vioscsireg.h: revision 1.1
	sys/dev/pci/virtioreg.h: revisions 1.5, 1.6
add the common flag bits
--
Add vioscsi, compile tested only (toxic)
--
this is working now, remove debugging.
--
add vioscsi
--
kill some more debugging.
--
Fake mode sense data for illegal targets. qemu reports 256 targets...
--
fix the status return.
--
Use SCSIPI_CHAN_NOSETTLE.
--
vioscsi_req_get()/virtio_enqueue_prep() failing is actually perfectly
normal - observed failures included 10, 27, 61 in-flight commands,
so probably depends on particular command mix; return with
XS_RESOURCE_SHORTAGE rather then panic
do vioscsi_req_put() when initial bus_dmamap_load() fails, as suggested
by the XXX; the vq_done hook is called by virtio, but in that case we
never get to commit the request to it
--
react on ADAPTER_REQ_SET_XFER_MODE so that we set tagged queuing
pass tag type and set id

Revision 1.6.2.3 / (download) - annotate - [select for diffs], Mon Dec 5 10:55:16 2016 UTC (7 years, 2 months ago) by skrll
Branch: nick-nhusb
Changes since 1.6.2.2: +44 -9 lines
Diff to previous 1.6.2.2 (colored) to branchpoint 1.6 (colored)

Sync with HEAD

Revision 1.6.4.1 / (download) - annotate - [select for diffs], Fri Nov 4 14:49:15 2016 UTC (7 years, 3 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.6: +44 -9 lines
Diff to previous 1.6 (colored)

Sync with HEAD

Revision 1.8.6.1, Tue Oct 4 18:23:24 2016 UTC (7 years, 4 months ago) by skrll
Branch: netbsd-7-nhusb
Changes since 1.8: +0 -559 lines
FILE REMOVED

file vioscsi.c was added on branch netbsd-7-nhusb on 2017-01-18 08:46:42 +0000

Revision 1.8.2.1, Tue Oct 4 18:23:24 2016 UTC (7 years, 4 months ago) by snj
Branch: netbsd-7
Changes since 1.8: +0 -559 lines
FILE REMOVED

file vioscsi.c was added on branch netbsd-7 on 2016-12-23 06:33:56 +0000

Revision 1.8 / (download) - annotate - [select for diffs], Tue Oct 4 18:23:24 2016 UTC (7 years, 4 months ago) by jdolecek
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107, pgoyette-localcount-20161104, nick-nhusb-base-20170204, nick-nhusb-base-20161204, bouyer-socketcan-base
Branch point for: netbsd-7-nhusb, netbsd-7, bouyer-socketcan
Changes since 1.7: +38 -3 lines
Diff to previous 1.7 (colored)

react on ADAPTER_REQ_SET_XFER_MODE so that we set tagged queuing

pass tag type and set id

Revision 1.7 / (download) - annotate - [select for diffs], Tue Oct 4 18:20:49 2016 UTC (7 years, 4 months ago) by jdolecek
Branch: MAIN
Changes since 1.6: +8 -8 lines
Diff to previous 1.6 (colored)

vioscsi_req_get()/virtio_enqueue_prep() failing is actually perfectly
normal - observed failures included 10, 27, 61 in-flight commands,
so probably depends on particular command mix; return with
XS_RESOURCE_SHORTAGE rather then panic

do vioscsi_req_put() when initial bus_dmamap_load() fails, as suggested
by the XXX; the vq_done hook is called by virtio, but in that case we never
get to commit the request to it

Revision 1.6.2.2 / (download) - annotate - [select for diffs], Sun Dec 27 12:09:57 2015 UTC (8 years, 2 months ago) by skrll
Branch: nick-nhusb
Changes since 1.6.2.1: +524 -0 lines
Diff to previous 1.6.2.1 (colored) to branchpoint 1.6 (colored)

Sync with HEAD (as of 26th Dec)

Revision 1.6.2.1, Sun Nov 1 08:55:05 2015 UTC (8 years, 3 months ago) by skrll
Branch: nick-nhusb
Changes since 1.6: +0 -524 lines
FILE REMOVED

file vioscsi.c was added on branch nick-nhusb on 2015-12-27 12:09:57 +0000

Revision 1.6 / (download) - annotate - [select for diffs], Sun Nov 1 08:55:05 2015 UTC (8 years, 3 months ago) by pooka
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, localcount-20160914
Branch point for: pgoyette-localcount, nick-nhusb
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (colored)

Use SCSIPI_CHAN_NOSETTLE.

Revision 1.5 / (download) - annotate - [select for diffs], Sat Oct 31 00:41:19 2015 UTC (8 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

fix the status return.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Oct 30 21:59:25 2015 UTC (8 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.3: +23 -11 lines
Diff to previous 1.3 (colored)

Fake mode sense data for illegal targets. qemu reports 256 targets...

Revision 1.3 / (download) - annotate - [select for diffs], Fri Oct 30 21:18:16 2015 UTC (8 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.2: +4 -6 lines
Diff to previous 1.2 (colored)

kill some more debugging.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Oct 30 21:15:05 2015 UTC (8 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.1: +27 -14 lines
Diff to previous 1.1 (colored)

this is working now, remove debugging.

Revision 1.1 / (download) - annotate - [select for diffs], Thu Oct 29 01:56:12 2015 UTC (8 years, 4 months ago) by christos
Branch: MAIN

Add vioscsi, compile tested only (toxic)

This form allows you to request diff's 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.




CVSweb <webmaster@jp.NetBSD.org>