hyperv/storvsc: storvsc_io_done(): do not use CAM_SEL_TIMEOUTCAM_SEL_TIMEOUT was introduced inhttps://reviews.freebsd.org/D7521 (r304251), which claimed:"VM shall response to CAM layer with CAM_
hyperv/storvsc: storvsc_io_done(): do not use CAM_SEL_TIMEOUTCAM_SEL_TIMEOUT was introduced inhttps://reviews.freebsd.org/D7521 (r304251), which claimed:"VM shall response to CAM layer with CAM_SEL_TIMEOUT to filter thoseinvalid LUNs. Never use CAM_DEV_NOT_THERE which will block LUN scanfor LUN number higher than 7."But it turns out this is not correct:I think what really filters the invalid LUNs in r304251 is that:before r304251, we could set the CAM_REQ_CMP without checkingvm_srb->srb_status at all:ccb->ccb_h.status |= CAM_REQ_CMP.r304251 checks vm_srb->srb_status and sets ccb->ccb_h.status properly,so the invalid LUNs are filtered.I changed my code version to r304251 but replaced the CAM_SEL_TIMEOUTwith CAM_DEV_NOT_THERE, and I confirmed the invalid LUNs can also befiltered, and I successfully hot-added and hot-removed 8 disks to/fromthe VM without any issue.CAM_SEL_TIMEOUT has an unwanted side effect -- see cam_periph_error():For a selection timeout, we consider all of the LUNs onthe target to be gone. If the status is CAM_DEV_NOT_THERE,then we only get rid of the device(s) specified by thepath in the original CCB.This means: for a VM with a valid LUN on 3:0:0:0, when the VM inquires3:0:0:1 and the host reports 3:0:0:1 doesn't exist and storvsc returnsCAM_SEL_TIMEOUT to the CAM layer, CAM will detech 3:0:0:0 as well: thisis the bug I reported recently:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226583PR: 226583Reviewed by: mavMFC after: 1 weekSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D14690
show more ...
Define xpt_path_inq.This provides a nice wrarpper around the XPT_PATH_INQ ccb creation andcalling.Sponsored by: NetflixDifferential Revision: https://reviews.freebsd.org/D13387
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
hyperv: Update copyright for the files changed in 2017MFC after: 3 daysSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D11982
hyperv/storvsc: Force SPC3 for CDROM attached.This unbreaks the CDROM attaching on GEN2 VMs. On GEN1 VMs, CDROM isattached to emulated ATA controller.PR: 220790Submitted by: Hongjiang Zhang <
hyperv/storvsc: Force SPC3 for CDROM attached.This unbreaks the CDROM attaching on GEN2 VMs. On GEN1 VMs, CDROM isattached to emulated ATA controller.PR: 220790Submitted by: Hongjiang Zhang <honzhan microsoft com>MFC after: 3 daysSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D11634
Clean up MD pollution of bus_dma.h:--Remove special-case handling of sparc64 bus_dmamap* functions. Replace with a more generic mechanism that allows MD busdma implementations to generate inlin
Clean up MD pollution of bus_dma.h:--Remove special-case handling of sparc64 bus_dmamap* functions. Replace with a more generic mechanism that allows MD busdma implementations to generate inline mapping functions by defining WANT_INLINE_DMAMAP in <machine/bus_dma.h>. This is currently useful for sparc64, x86, and arm64, which all implement non-load dmamap operations as simple wrappers around map objects which may be bus- or device-specific.--Remove NULL-checked bus_dmamap macros. Implement the equivalent NULL checks in the inlined x86 implementation. For non-x86 platforms, these checks are a minor pessimization as those platforms do not currently allow NULL maps. NULL maps were originally allowed on arm64, which appears to have been the motivation behind adding arm[64]-specific barriers to bus_dma.h, but that support was removed in r299463.--Simplify the internal interface used by the bus_dmamap_load* variants and move it to bus_dma_internal.h--Fix some drivers that directly include sys/bus_dma.h despite the recommendations of bus_dma(9)Reviewed by: kib (previous revision), mariusDifferential Revision: https://reviews.freebsd.org/D10729
hyperv/storvsc: Reduce log verbosityOn some windows hosts TEST_UNIT_READY command will returnSRB_STATUS_ERROR and sense data "NOT READY asc:3a,1 (Mediumnot present - tray closed)", this occurs pe
hyperv/storvsc: Reduce log verbosityOn some windows hosts TEST_UNIT_READY command will returnSRB_STATUS_ERROR and sense data "NOT READY asc:3a,1 (Mediumnot present - tray closed)", this occurs periodically, andnot hurt anything else. So, we prefer to ignore this kindof errors.PR: 219973Submitted by: Hongjiang Zhang <hongzhan microsoft com>MFC after: 3 daysSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D11271
hyperv/storvsc: Use ULL for 64bits value shift.Reported by: PVSMFC after: 3 daysSponsored by: Microsoft
hyperv/storvsc: Fixup SRB status.This unbreaks GEN2 Hyper-V cd support.Submitted by: Hongjiang Zhang <honzhan microsoft com>Reviewed by: dexuan@MFC after: 3 daysSponsored by: MicrosoftDiffere
hyperv/storvsc: Fixup SRB status.This unbreaks GEN2 Hyper-V cd support.Submitted by: Hongjiang Zhang <honzhan microsoft com>Reviewed by: dexuan@MFC after: 3 daysSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D10212
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq arefixed-length strings. AFAICT the only place they're read is insbin/c
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq arefixed-length strings. AFAICT the only place they're read is insbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.However, the kernel doesn't null-terminate them. A bunch of copy-pasted codeuses strncpy to write them, and doesn't guarantee null-termination. For atleast 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actuallyoverflows. You can see the result by doing "camcontrol negotiate da0 -v".This change null-terminates those fields everywhere they're set in thekernel. It also shortens a few strings to ensure they'll fit within the16-character field.PR: 215474Reported by: CoverityCID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187CID: 1010035 1010036 1010042 1010041 1010040 1010039Reviewed by: imp, sephe, slmMFC after: 4 weeksSponsored by: Spectra Logic CorpDifferential Revision: https://reviews.freebsd.org/D9037Differential Revision: https://reviews.freebsd.org/D9038
hyperv/storvsc: The max channel in PDU actually means the max sub-chans.Use proper name for local variables. PDU fields' name was not changed yet.While I'm here, make # of usable channels tunable.
hyperv/storvsc: The max channel in PDU actually means the max sub-chans.Use proper name for local variables. PDU fields' name was not changed yet.While I'm here, make # of usable channels tunable. This eases furthertesting.MFC after: 1 weekSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D8851
hyperv/storvsc: Minor style changes; no functional changes.Reported by: rpokalaMFC after: 1 weekSponsored by: Microsoft
hyperv/storvsc: Fix the SCSI disk attachment issue.On pre-WS2016 Hyper-V, if the only LUNs > 7 are used, then all disksfails to attach. Mainly because those versions of Hyper-V do not setSRB_STA
hyperv/storvsc: Fix the SCSI disk attachment issue.On pre-WS2016 Hyper-V, if the only LUNs > 7 are used, then all disksfails to attach. Mainly because those versions of Hyper-V do not setSRB_STATUS properly and deliver junky INQUERY responses.Submitted by: Hongjiang Zhang <honzhan microsoft com>Reported by: Hongxiong Xian <v-hoxian microsoft com>MFC after: 1 weekSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D8724
hyperv/storvsc: Don't use timedwait.The timeout is unnecessary.Reviewed by: jhbMFC after: 1 weekSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D8656
hyperv/stor: Fix off-by-one bug; this brings back TRIM support.Submitted by: Hongjiang Zhang <honzhan microsoft com>Reported by: Lili Deng <v-lide microsoft com>MFC after: 3 daysSponsored by: Mi
hyperv/stor: Fix off-by-one bug; this brings back TRIM support.Submitted by: Hongjiang Zhang <honzhan microsoft com>Reported by: Lili Deng <v-lide microsoft com>MFC after: 3 daysSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D8238
hyperv/storvsc: Fix the blkvsc disk attachment issues.- The original 'disengage' ATA controller model does not work properly for all possible disk configurations. Use the newly added ATA disk
hyperv/storvsc: Fix the blkvsc disk attachment issues.- The original 'disengage' ATA controller model does not work properly for all possible disk configurations. Use the newly added ATA disk veto eventhandler to fit into all possible disk configuration.- If the 'invalid LUN' happens on blkvsc controllers, return CAM_DEV_NOT_THERE so that CAM will not destroy attached disks under the blkvsc controllers.Submitted by: Hongjiang Zhang <honzhan microsoft com>Discussed with: mavMFC after: 1 weekSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D7693
hyperv/storvsc: Fix SRB length setting.This fixes disk discovery issue on WS2008R2 Hyper-V, which plaguedus since 10.2-release.Reported by: manyMFC after: 3 daysSponsored by: Microsoft
hyperv/storvsc: Increase queue depth and rework channel selection.- Increasing queue depth gives ~100% performance improvement for randwrite fio test in Azure.- New channel selection, which take
hyperv/storvsc: Increase queue depth and rework channel selection.- Increasing queue depth gives ~100% performance improvement for randwrite fio test in Azure.- New channel selection, which takes LUN id and the current cpuid into consideration, gives additional ~20% performance improvement for ranwrite fio test in Azure.Submitted by: Hongzhang Jiang <honzhan microsoft com>Modified by: sepheMFC after: 1 weekSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D7622
hyperv/storvsc: Deliver CAM_SEL_TIMEOUT upon SRB status error.SRB status is set to 0x20 by the hypervisor, if the specified LUN isunaccessible, and even worse the INQUIRY response will not be set
hyperv/storvsc: Deliver CAM_SEL_TIMEOUT upon SRB status error.SRB status is set to 0x20 by the hypervisor, if the specified LUN isunaccessible, and even worse the INQUIRY response will not be set bythe hypervisor at all under this situation. Additionally, SRB statusis 0x20 too, for TUR on an unaccessible LUN.Deliver CAM_SEL_TIMEOUT to CAM upon SRB status errors as suggested byScott Long, other values seems improper.This commit fixes the Hyper-V disk hotplug support.Submitted by: Hongjiang Zhang <honzhan microsoft com>MFC after: 3 daysSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D7521
hyperv/storvsc: Claim SPC-3 conformance, thus enable UNMAP supportThe Hyper-V on pre-win10 systems will only report SPC-2 conformance,but it actually conforms to SPC-3. The INQUIRY response is ad
hyperv/storvsc: Claim SPC-3 conformance, thus enable UNMAP supportThe Hyper-V on pre-win10 systems will only report SPC-2 conformance,but it actually conforms to SPC-3. The INQUIRY response is adjustedto propagate the SPC-3 version information to CAM.Submitted by: Hongjiang Zhang <honzhan microsoft com>MFC after: 3 daysSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D7405
hyperv/storvsc: Stringent PRP list assertionsMFC after: 1 weekSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D7361
hyperv/storvsc: Set maxio to 128KB.MFC after: 1 weekSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D7360
hyperv/vmbus: Remove the artificial entry limit of SG and PRP list.Just make sure that the total channel packet size does not exceed 1/2data size of the TX bufring.MFC after: 1 weekSponsored by
hyperv/vmbus: Remove the artificial entry limit of SG and PRP list.Just make sure that the total channel packet size does not exceed 1/2data size of the TX bufring.MFC after: 1 weekSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D7359
hyperv/storvsc: Use busdma(9) and enable PIM_UNMAPPED by default.The UNMAPPED I/O greatly improves userland direct disk I/O performanceby 35% ~ 135%.Submitted by: Hongjiang Zhang <honzhan micros
hyperv/storvsc: Use busdma(9) and enable PIM_UNMAPPED by default.The UNMAPPED I/O greatly improves userland direct disk I/O performanceby 35% ~ 135%.Submitted by: Hongjiang Zhang <honzhan microsoft com>MFC after: 1 weekSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D7195
hyperv/vmbus: Inclusion cleanupMFC after: 1 weekSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D7334
123