Fix minor buffer overflow reported by Coverity.

CID:		1006781
(cherry picked from commit aa30f2d2de093521ce4245a97a46a41c52ffb3ad)
Fix memory leak on error, reported by Coverity.

CID:		1007773
(cherry picked from commit 8633346319dd121efa70e40e0be37acc9551d378)
Fix couple off-by-one range check errors, reported by Coverity.

CID:		1007837
(cherry picked from commit a209c226c546b8b98b04ded0d3980e500c3a626e)
Fix array overrun, reported by Coverity.

CID:		1229970
(cherry picked from commit 4db7e51eb21db397e3251d89396446e11e97972a)
Remove uninitialized and unused variable, reported by Coverity.

CID:		1230015
(cherry picked from commit 20136fb37c5697db2a887bebc4240379d685aa90)
Make ctl_port_mask an array to support more then 32 ports.

Overflow reported by Coverity.

CID:		1229894
MFC after:	3 days

(cherry picked from commit 645f3f53cf53a90202ed8efe564952087b9447ad)
Make it possible to disable NOP-In PDUs by the iSCSI initiator by setting
kern.cam.ctl.iscsi.ping_timeout to 0.  This fixes interoperability with
some initiators that don't properly support NOP-Ins, namely iPXE/gPXE.

Submitted by:	Chen Wen <pokkys@gmail.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 6cacb7cf778fd2c20de9f18c03dab6cfd10d015a)
Make sure we handle less than zero timeouts in iSCSI initiator and target
in a reasonable way.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit d8aaa0480ad6b6338180fa978ed574f0cb35004c)
Add support for Extended INQUIRY Data (0x86) VPD page.

(cherry picked from commit a132abedb0496e25270631e950c8089692b13d8b)
Implement range checks between UNMAP and READ/WRITE commands.

Before this change UNMAP completely blocked other I/Os while running.
Now it blocks only colliding ones, slowing down others only due to ZFS
locks collisions.

Sponsored by:	iXsystems, Inc.

(cherry picked from commit d38ee298689653c70b76d3fe5f498287ca706fa6)
Add "readcache" and "writecache" LUN options to control default behavior.

Default values are "on".  Disabling requires backend to support IO_DIRECT
and IO_SYNC flags respectively, or some alternatives.

(cherry picked from commit 20d551b720cdef4df77f1910630877f3b6a4d7a8)
Implement control over command reordering via options and control mode page.

It allows to bypass range checks between UNMAP and READ/WRITE commands,
which may introduce additional delays while waiting for UNMAP parameters.
READ and WRITE commands are always processed in safe order since their
range checks are almost free.

(cherry picked from commit 01d0aad79892713eb6cabc3287091a9568d492b1)