Commit Graph

438 Commits

Author SHA1 Message Date
pfg
8932da33aa sys/cam: spelling fixes in comments.
No functional change.
2016-04-29 21:05:48 +00:00
pfg
fe28ec8024 cam: unsign some types to match their definitions and avoid overflows.
numpatterns is u_int.

ctl:
CTL_NUM_MODE_PAGES comes from sizeof().
In struct:ctl_scsiio, kern_sg_entries is uint32_t.

MFC after:	2 weeks
2016-04-27 15:35:05 +00:00
sbruno
edd3a7f3f9 Plug memory leak in ctl(4) when ctl_copyin_args() is called with a non-
null terminated ASCII string.

PR:		207626
Submitted by:	cturt@hardenedbsd.org
MFC after:	2 days
2016-04-19 16:48:14 +00:00
pfg
b63211eed5 Cleanup unnecessary semicolons from the kernel.
Found with devel/coccinelle.
2016-04-10 23:07:00 +00:00
imp
95982d7b7a Move to new value for XPT_GET_SIM_KNOB to avoid clash with XPT_ATA_IO. 2016-03-10 06:25:05 +00:00
mav
203b8c4697 Set bhsdi_target_transfer_tag to reserved value, which is 0xffffffff.
This should be a purely cosmetic change.
2016-03-04 19:57:11 +00:00
trasz
97d8d42022 Remove stray semicolons from the iSCSI code.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-10 17:55:39 +00:00
mav
3610cee751 Hide "soconnect() error" messages under bootverbose.
They can be too noisy.
2016-01-22 09:32:19 +00:00
kib
b96b9a6148 Convert sys/cam to use make_dev_s().
Reviewed by:	hps, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D4746
2016-01-07 20:22:55 +00:00
markj
fa1b8e9a4f Fix style issues around existing SDT probes.
- Use SDT_PROBE<N>() instead of SDT_PROBE(). This has no functional effect
  at the moment, but will be needed for some future changes.
- Don't hardcode the module component of the probe identifier. This is
  set automatically by the SDT framework.

MFC after:	1 week
2015-12-16 23:39:27 +00:00
mav
dee08d7b3f Set DS flag, required for LPB log page by spec.
MFC after:	1 week
2015-12-15 21:19:32 +00:00
mav
e2706f2c8a Fix panic when trying to sort unsupported command in OOA queue.
Handle unsupported commands as not conflicting/blocking.
2015-11-27 14:29:04 +00:00
mav
beb14530b9 Add NULL check to make Coverity happy. 2015-11-14 14:56:01 +00:00
mav
6748d44685 Modify target port groups logic in CTL.
- Introduce "ha_shared" port option, which being set to "on" moves the
port into separate port group, shared between HA nodes.  This allows to
better handle cases when iSCSI portals are bound to CARP address that can
dynamically move between nodes.  Some initiators (at least VMware) don't
detect that after iSCSI reconnect they've attached to different SCSI port
from different port group, that totally breakes ALUA status parsing.
In theory, I believe, it should be enough to have different iSCSI portal
group tags on different nodes to make initiators detect this condition,
but it seems like VMware ignores those values, and even full LUN retaste
forced by UA does not help.
 - Make CTL report up to three port groups: 1 -- non-HA mode or ports
with "ha_shared" option set, 2 -- HA node 1, 3 -- HA node 2.
 - Report Transitioning state for all port groups when HA interlink is
connected, but neither of nodes is primary for the LUN.

MFC after:	2 weeks
2015-11-11 13:18:38 +00:00
mav
ea0bf14fa7 Add two more KASSERTs. 2015-11-06 17:29:21 +00:00
mav
7da4fecded Don't try to replicate mode pages not present on this device.
MFC after:	3 days
2015-10-26 14:14:56 +00:00
mav
f82829966f Give CTL support for PIM_EXTLUNS when talking to CAM.
CTL itself still lives in flat LUN space, but it can generate extended
numbers if CAM SIM reports such capability.
2015-10-24 17:24:19 +00:00
mav
9545bdb164 Add partial support for QUERY TMF to CAM and isp(4).
This change allows to decode respective functions in isp(4) in target mode
and pass them through CAM to CTL.  Unfortunately neither CAM nor isp(4)
support returning response info for those task management functions now.

On the other side I just have no initiator to test this functionality.
2015-10-23 18:34:18 +00:00
mav
52c58ca4ec Fix LUN disable in CAM broken at r285155.
MFC after:	1 week
2015-10-23 10:39:43 +00:00
mav
1a70c15562 Make some panic strings mode informative. 2015-10-21 15:31:26 +00:00
mav
1fd9c17d05 Remove lock upgrade attempt from ctl_be_block_open_file().
I am not sure what for it was done.  Now open routine should automatically
fall back to read-only if open for writing is impossible.  In such case
attempt to upgrade to write sounds strange.

MFC after:	1 week
2015-10-11 08:28:49 +00:00
mav
ba153888c0 Add missing vnode lock in case of file modify request.
Submitted by:	Richard Kojedzinszky
MFC after:	1 week
2015-10-08 07:34:30 +00:00
mav
ebebc98996 More aggressively fill WUT read pipeline.
On some tests I've measured 5% copy speedup from this.
2015-10-01 19:07:15 +00:00
mav
547cc1d0b5 Make zero WUT use WRITE SAME with recently allowed NDOB flag. 2015-10-01 16:30:20 +00:00
mav
8111cd0fbf Implement SPC-3 exceptions to SPC-2 RESERVE and RELEASE behavior. 2015-10-01 12:57:37 +00:00
mav
14e7a5f18f Unify PR variable names to reduce confusion. 2015-10-01 12:15:36 +00:00
mav
71ccc7181f Use proper STAILQ_* macros where possible. 2015-09-30 20:38:35 +00:00
mav
e0c0584312 Really implement PREVENT ALLOW MEDIUM REMOVAL command. 2015-09-29 15:12:40 +00:00
mav
40c97f8765 Don't report SYNC_NV bit set in SYNCHRONIZE CACHE as error.
While this bit is obsolete in SBC-3, behavior controlled by it is allowed
on device discretion.
2015-09-29 13:58:27 +00:00
mav
85c07e2f66 Fix arguments order. 2015-09-29 12:53:41 +00:00
mav
9aafc68811 Report that we can read all flavours of DVD. Why not? 2015-09-29 10:44:37 +00:00
mav
a9dd74ee84 Add CD/DVD Capabilities and Mechanical Status Page.
This page is obsolete since MMC-4, but still used by some software.
2015-09-29 09:09:37 +00:00
mav
fb08575948 Umplement media load/eject support for removable devices.
In case of block backend eject really closes the backing store, while
load tries to open it back.  Failed store open is reported as no media.
2015-09-28 20:54:18 +00:00
mav
ba6084f689 Add to CTL initial support for CDROMs and removable devices.
Relnotes:	yes
2015-09-27 13:47:28 +00:00
mav
9a25467988 Allow LOG SENSE command on non-disk devices. 2015-09-26 13:51:29 +00:00
mav
7903c2e5c3 Remove concept of control device. 2015-09-26 12:53:55 +00:00
mav
9bb4838c10 Move ioctl frontend defines where they belong. 2015-09-26 11:56:28 +00:00
mav
4fe0be11b5 Remove few more unused variables. 2015-09-26 11:39:54 +00:00
mav
70f018005e Remove some duplicate, legacy, dead and questionable code. 2015-09-26 11:28:45 +00:00
mav
da3031ba34 Pass to sobind() copy of the address, not the original. 2015-09-26 01:23:29 +00:00
mav
68c4bb4bd1 Properly lock LUN in ctl_failover_lun(). 2015-09-25 22:45:23 +00:00
mav
666e15d04a Fix bit masks changed for the wrong commands in r288221. 2015-09-25 19:46:34 +00:00
mav
c46f2e1439 Constify ctl_serialize_table. 2015-09-25 18:49:25 +00:00
mav
048c6e7723 Remove some dead code found by Clang analyzer. 2015-09-25 18:15:34 +00:00
mav
4d45b292aa Remove stale comments and some excessive empty lines. 2015-09-25 16:34:59 +00:00
mav
dc7c5180b5 Switch I/O time accounting from system time to uptime.
While there, make num_dmas accounted independently of CTL_TIME_IO.
2015-09-25 10:14:39 +00:00
mav
87240643a5 Collect DMA statistics on secondary HA node. 2015-09-25 09:55:51 +00:00
mav
e36a0596e3 Make HA handle datamove and done in a universal way, using port methods.
Now from primary node point of view requests transferred from secondary
node should look almost normal and always have valid port.
2015-09-25 09:14:29 +00:00
mav
ba2d211568 Remove some control_softc references. 2015-09-25 07:27:23 +00:00
mav
f83f810204 Allow WRITE SAME with NDOB bit set but without UNMAP.
This combination was originally forbidden, but allowed at spc4r3.
2015-09-24 15:59:08 +00:00