<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/isp, branch release/12.4.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>isp: Remove a double word in the driver manual</title>
<updated>2022-09-13T05:26:05+00:00</updated>
<author>
<name>Gordon Bergling</name>
<email>gbe@FreeBSD.org</email>
</author>
<published>2022-09-10T11:03:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ea16cf9fec93fea9a47ddf1e9fc1e95b6f2a89ea'/>
<id>ea16cf9fec93fea9a47ddf1e9fc1e95b6f2a89ea</id>
<content type='text'>
 - s/to to/to/

(cherry picked from commit a5beac3992fb874e57768b3c8d852a806bcb8b21)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 - s/to to/to/

(cherry picked from commit a5beac3992fb874e57768b3c8d852a806bcb8b21)
</pre>
</div>
</content>
</entry>
<entry>
<title>isp(4): Fix two typos in source code comments</title>
<updated>2022-09-06T05:45:13+00:00</updated>
<author>
<name>Gordon Bergling</name>
<email>gbe@FreeBSD.org</email>
</author>
<published>2022-09-03T12:54:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=056e4dde7b4f21374e7b2fb6b7d66a788e6e2686'/>
<id>056e4dde7b4f21374e7b2fb6b7d66a788e6e2686</id>
<content type='text'>
- s/overriden/overridden/

(cherry picked from commit 310d144a83411abedc17bfeec07f1f7ccee2434e)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- s/overriden/overridden/

(cherry picked from commit 310d144a83411abedc17bfeec07f1f7ccee2434e)
</pre>
</div>
</content>
</entry>
<entry>
<title>isp(4): Allow more than 2 ports to read WWNs from NVRAM.</title>
<updated>2021-12-21T01:09:36+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2021-12-14T18:20:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ad5d75d884484f79f77711305ea36538531ca1bc'/>
<id>ad5d75d884484f79f77711305ea36538531ca1bc</id>
<content type='text'>
It appears at least on QLE2694L cards 3rd and 4th ports follow the
same NVRAM addressing logic as the first two.  In lack of proper
documentation this guess is as good as it can be.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.

(cherry picked from commit 483e464ed4325a0710485925ecfbe0e1c8d6bb02)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It appears at least on QLE2694L cards 3rd and 4th ports follow the
same NVRAM addressing logic as the first two.  In lack of proper
documentation this guess is as good as it can be.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.

(cherry picked from commit 483e464ed4325a0710485925ecfbe0e1c8d6bb02)
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r367985: Remove unneeded locking around xpt_bus_[de]register().</title>
<updated>2020-12-08T00:58:02+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2020-12-08T00:58:02+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fe7427eb08cc699e6b438626f6c97cee665069cb'/>
<id>fe7427eb08cc699e6b438626f6c97cee665069cb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r367044: Introduce support of SCSI Command Priority.</title>
<updated>2020-11-24T13:17:12+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2020-11-24T13:17:12+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4b74fa5dd5aef9786aee4f9359be15b9da9a096d'/>
<id>4b74fa5dd5aef9786aee4f9359be15b9da9a096d</id>
<content type='text'>
SAM-3 specification introduced concept of Task Priority, that was renamed
to Command Priority in SAM-4, and supported by all modern SCSI transports.
It provides 15 levels of relative priorities: 1 - highest, 15 - lowest and
0 - default.  SAT specification for SATA devices translates priorities 1-3
into NCQ high priority.

This change adds new "priority" field into empty spots of struct ccb_scsiio
and struct ccb_accept_tio of CAM and struct ctl_scsiio of CTL.  Respective
support is added into iscsi(4), isp(4), mpr(4), mps(4) and ocs_fc(4) drivers
for both initiator and where applicable target roles.  Minimal support was
added to CTL to receive the priority value from different frontends, pass it
between HA controllers and report in few places.

This patch does not add consumers of this functionality, so nothing should
really change yet, since the field is still set to 0 (default) on initiator
and not actively used on target.  Those are to be implemented separately.

I've confirmed priority working on WD Red SATA disks connected via mpr(4)
and properly transferred to CTL target via iscsi(4), isp(4) and ocs_fc(4).

While there, added missing tag_action support to ocs_fc(4) initiator role.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SAM-3 specification introduced concept of Task Priority, that was renamed
to Command Priority in SAM-4, and supported by all modern SCSI transports.
It provides 15 levels of relative priorities: 1 - highest, 15 - lowest and
0 - default.  SAT specification for SATA devices translates priorities 1-3
into NCQ high priority.

This change adds new "priority" field into empty spots of struct ccb_scsiio
and struct ccb_accept_tio of CAM and struct ctl_scsiio of CTL.  Respective
support is added into iscsi(4), isp(4), mpr(4), mps(4) and ocs_fc(4) drivers
for both initiator and where applicable target roles.  Minimal support was
added to CTL to receive the priority value from different frontends, pass it
between HA controllers and report in few places.

This patch does not add consumers of this functionality, so nothing should
really change yet, since the field is still set to 0 (default) on initiator
and not actively used on target.  Those are to be implemented separately.

I've confirmed priority working on WD Red SATA disks connected via mpr(4)
and properly transferred to CTL target via iscsi(4), isp(4) and ocs_fc(4).

While there, added missing tag_action support to ocs_fc(4) initiator role.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r348247:</title>
<updated>2019-05-31T20:15:29+00:00</updated>
<author>
<name>Kenneth D. Merry</name>
<email>ken@FreeBSD.org</email>
</author>
<published>2019-05-31T20:15:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7aacf0554b29d47d340eccf6dca1b31eba35dd61'/>
<id>7aacf0554b29d47d340eccf6dca1b31eba35dd61</id>
<content type='text'>
  ------------------------------------------------------------------------
  r348247 | ken | 2019-05-24 13:58:29 -0400 (Fri, 24 May 2019) | 57 lines

  Fix FC-Tape bugs caused in part by r345008.

  The point of r345008 was to reset the Command Reference Number (CRN)
  in some situations where a device stayed in the topology, but had
  changed somehow.

  This can include moving from a switch connection to a direct
  connection or vice versa, or a device that temporarily goes away
  and comes back.  (e.g. moving to a different switch port)

  There were a couple of bugs in that change:
  - We were reporting that a device had not changed whenever the
    Establish Image Pair bit was not set.  That is not quite correct.
    Instead, if the Establish Image Pair bit stays the same (set or
    not), the device hasn't changed in that way.

  - We weren't setting PRLI Word0 in the port database when a new
    device arrived, so comparisons with the old value for the
    Establish Image Pair bit weren't really possible.  So, make sure
    PRLI Word0 is set in the port database for new devices.

  - We were resetting the CRN whenever the Establish Image Pair bit
    was set for a device, even when the device had stayed the same
    and the value of the bit hadn't changed.  Now, only reset the
    CRN for devices that have changed, not devices that sayed the
    same.

  The result of all of this was that if we had a single FC device on
  an FC port and it went away and came back, we would wind up
  correctly resetting the CRN.

  But, if we had multiple devices connected via a switch, and there
  was any change in one or more of those devices, all of the devices
  that stayed the same would also have their CRN values reset.

  The result, from a user standpoint, is that the tape drives, etc.
  would all start to time out commands and the initiator would send
  aborts.

  sys/dev/isp/isp.c:
  	In isp_pdb_add_update(), look at whether the Establish
  	Image Pair bit has changed as part of the check to
  	determine whether a device is still the same.   This was
  	causing erroneous change notifications.  Also, when
  	creating a new port database entry, initialize the
  	PRLI Word 0 values.

  sys/dev/isp/isp_freebsd.c:
  	In isp_async(), in the changed/stayed case, instead of
  	looking at the Establish Image Pair bit to determine
  	whether to reset the CRN, look at the command value.
  	(Changed vs. Stayed.)  Only reset the CRN for devices
  	that have changed.

  ------------------------------------------------------------------------

Sponsored by:	Spectra Logic
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  ------------------------------------------------------------------------
  r348247 | ken | 2019-05-24 13:58:29 -0400 (Fri, 24 May 2019) | 57 lines

  Fix FC-Tape bugs caused in part by r345008.

  The point of r345008 was to reset the Command Reference Number (CRN)
  in some situations where a device stayed in the topology, but had
  changed somehow.

  This can include moving from a switch connection to a direct
  connection or vice versa, or a device that temporarily goes away
  and comes back.  (e.g. moving to a different switch port)

  There were a couple of bugs in that change:
  - We were reporting that a device had not changed whenever the
    Establish Image Pair bit was not set.  That is not quite correct.
    Instead, if the Establish Image Pair bit stays the same (set or
    not), the device hasn't changed in that way.

  - We weren't setting PRLI Word0 in the port database when a new
    device arrived, so comparisons with the old value for the
    Establish Image Pair bit weren't really possible.  So, make sure
    PRLI Word0 is set in the port database for new devices.

  - We were resetting the CRN whenever the Establish Image Pair bit
    was set for a device, even when the device had stayed the same
    and the value of the bit hadn't changed.  Now, only reset the
    CRN for devices that have changed, not devices that sayed the
    same.

  The result of all of this was that if we had a single FC device on
  an FC port and it went away and came back, we would wind up
  correctly resetting the CRN.

  But, if we had multiple devices connected via a switch, and there
  was any change in one or more of those devices, all of the devices
  that stayed the same would also have their CRN values reset.

  The result, from a user standpoint, is that the tape drives, etc.
  would all start to time out commands and the initiator would send
  aborts.

  sys/dev/isp/isp.c:
  	In isp_pdb_add_update(), look at whether the Establish
  	Image Pair bit has changed as part of the check to
  	determine whether a device is still the same.   This was
  	causing erroneous change notifications.  Also, when
  	creating a new port database entry, initialize the
  	PRLI Word 0 values.

  sys/dev/isp/isp_freebsd.c:
  	In isp_async(), in the changed/stayed case, instead of
  	looking at the Establish Image Pair bit to determine
  	whether to reset the CRN, look at the command value.
  	(Changed vs. Stayed.)  Only reset the CRN for devices
  	that have changed.

  ------------------------------------------------------------------------

Sponsored by:	Spectra Logic
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r345008:</title>
<updated>2019-05-17T14:29:56+00:00</updated>
<author>
<name>Kenneth D. Merry</name>
<email>ken@FreeBSD.org</email>
</author>
<published>2019-05-17T14:29:56+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5d949247b7e2a50cd8bba156bf4d09db6176c5a3'/>
<id>5d949247b7e2a50cd8bba156bf4d09db6176c5a3</id>
<content type='text'>
  ------------------------------------------------------------------------
  r345008 | ken | 2019-03-11 10:21:14 -0400 (Mon, 11 Mar 2019) | 59 lines

  Fix CRN resets in the isp(4) driver in certain situations.

  The Command Reference Number (CRN) is part of the FC-Tape features
  that we enable when talking to tape drives.  It starts at 1, and
  goes to 255 and wraps around to 1.  There are a number of reset
  type conditions that result in the CRN getting reset to 1.  These
  are detailed in section 4.10 (table 8) of the FCP-4r02b specification.

  One of the conditions is when a PRLI (Process Login) is sent by
  the initiator, and the Establish Image Pair bit is set in Word 0
  of the PRLI.

  Previously, the isp(4) driver core sent a notification via
  isp_async() that the target had changed or stayed in place, but
  there was no indication of whether a PRLI was sent and whether the
  Establish Image Pair bit was set.

  The result of this was that in some situations, notably
  switching back and forth between a direct connection and a switch
  connection to a tape drive, the isp(4) driver would fail to reset
  the CRN in situations that require it according to the spec.  When
  the CRN isn't reset in a situation that requires it, the tape drive
  then rejects every subsequent command that is sent to the drive.
  It is assuming that the commands are being sent out of order.

  So, modify the isp(4) driver to include Word 0 of the PRLI command
  when it sends isp_async() notifications of target changes.  Look at
  the Establish Image Pair bit, and reset the CRN if that bit is set.

  With this change, I am able to switch a tape drive back and forth
  between a direct connection and a switch connection, and the isp(4)
  driver resets the CRN when it should.

  sys/dev/isp_stds.h:
  	Add bit definitions for PRLI Word 0.

  sys/dev/ispmbox.h:
  	Add PRLI Word 0 to the port database type, isp_pdb_t.

  sys/dev/ispvar.h
  	Add PRLI Word 0 to fcportdb_t.

  sys/dev/isp.c:
  	Populate the new prli_word0 parameter in the port database.

  	In isp_pdb_add_update(), add a check to see if the
  	Establish Image Pair bit is set in PRLI Word 0.  If it is,
  	then that is an additional reason to create a change
  	notification.

  sys/dev/isp_freebsd.c:
  	In isp_async(), if the device changed or stayed, look at
  	PRLI Word 0 to see if the Establish Image Pair bit is set.
  	If it is, reset the CRN if we haven't already.

  Sponsored by:	Spectra Logic

  ------------------------------------------------------------------------
Differential Revision:	https://reviews.freebsd.org/D19472
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  ------------------------------------------------------------------------
  r345008 | ken | 2019-03-11 10:21:14 -0400 (Mon, 11 Mar 2019) | 59 lines

  Fix CRN resets in the isp(4) driver in certain situations.

  The Command Reference Number (CRN) is part of the FC-Tape features
  that we enable when talking to tape drives.  It starts at 1, and
  goes to 255 and wraps around to 1.  There are a number of reset
  type conditions that result in the CRN getting reset to 1.  These
  are detailed in section 4.10 (table 8) of the FCP-4r02b specification.

  One of the conditions is when a PRLI (Process Login) is sent by
  the initiator, and the Establish Image Pair bit is set in Word 0
  of the PRLI.

  Previously, the isp(4) driver core sent a notification via
  isp_async() that the target had changed or stayed in place, but
  there was no indication of whether a PRLI was sent and whether the
  Establish Image Pair bit was set.

  The result of this was that in some situations, notably
  switching back and forth between a direct connection and a switch
  connection to a tape drive, the isp(4) driver would fail to reset
  the CRN in situations that require it according to the spec.  When
  the CRN isn't reset in a situation that requires it, the tape drive
  then rejects every subsequent command that is sent to the drive.
  It is assuming that the commands are being sent out of order.

  So, modify the isp(4) driver to include Word 0 of the PRLI command
  when it sends isp_async() notifications of target changes.  Look at
  the Establish Image Pair bit, and reset the CRN if that bit is set.

  With this change, I am able to switch a tape drive back and forth
  between a direct connection and a switch connection, and the isp(4)
  driver resets the CRN when it should.

  sys/dev/isp_stds.h:
  	Add bit definitions for PRLI Word 0.

  sys/dev/ispmbox.h:
  	Add PRLI Word 0 to the port database type, isp_pdb_t.

  sys/dev/ispvar.h
  	Add PRLI Word 0 to fcportdb_t.

  sys/dev/isp.c:
  	Populate the new prli_word0 parameter in the port database.

  	In isp_pdb_add_update(), add a check to see if the
  	Establish Image Pair bit is set in PRLI Word 0.  If it is,
  	then that is an additional reason to create a change
  	notification.

  sys/dev/isp_freebsd.c:
  	In isp_async(), if the device changed or stayed, look at
  	PRLI Word 0 to see if the Establish Image Pair bit is set.
  	If it is, reset the CRN if we haven't already.

  Sponsored by:	Spectra Logic

  ------------------------------------------------------------------------
Differential Revision:	https://reviews.freebsd.org/D19472
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r344661, r344669: Limit 24xx adapters to only MSI interrupts by default.</title>
<updated>2019-03-08T00:56:07+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2019-03-08T00:56:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4a611c712882ac9ab5d07c594aa82f2561e5bcaf'/>
<id>4a611c712882ac9ab5d07c594aa82f2561e5bcaf</id>
<content type='text'>
This was actually the known good configuration we used before.
Single MSI-X configuration doesn't even work there on my tests, just due
to lack of documentation not sure whether by design or I am doing something
wrong.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was actually the known good configuration we used before.
Single MSI-X configuration doesn't even work there on my tests, just due
to lack of documentation not sure whether by design or I am doing something
wrong.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r344660: Add to isp(4) tunables to limit MSI/MSI-X usage.</title>
<updated>2019-03-08T00:54:34+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2019-03-08T00:54:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=83d9b5559bedab547d7b05cc2f194283bdb47dc7'/>
<id>83d9b5559bedab547d7b05cc2f194283bdb47dc7</id>
<content type='text'>
There are some problem reports possibly related to the new driver use of
multiple interrupts on older cards.  Hopefully this allow to workaround
them.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are some problem reports possibly related to the new driver use of
multiple interrupts on older cards.  Hopefully this allow to workaround
them.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make timespecadd(3) and friends public</title>
<updated>2018-07-30T15:46:40+00:00</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2018-07-30T15:46:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=6040822c4e20fb46638ecaaad543fc56f6ec2b0f'/>
<id>6040822c4e20fb46638ecaaad543fc56f6ec2b0f</id>
<content type='text'>
The timespecadd(3) family of macros were imported from NetBSD back in
r35029. However, they were initially guarded by #ifdef _KERNEL. In the
meantime, we have grown at least 28 syscalls that use timespecs in some
way, leading many programs both inside and outside of the base system to
redefine those macros. It's better just to make the definitions public.

Our kernel currently defines two-argument versions of timespecadd and
timespecsub.  NetBSD, OpenBSD, and FreeDesktop.org's libbsd, however, define
three-argument versions.  Solaris also defines a three-argument version, but
only in its kernel.  This revision changes our definition to match the
common three-argument version.

Bump _FreeBSD_version due to the breaking KPI change.

Discussed with:	cem, jilles, ian, bde
Differential Revision:	https://reviews.freebsd.org/D14725
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The timespecadd(3) family of macros were imported from NetBSD back in
r35029. However, they were initially guarded by #ifdef _KERNEL. In the
meantime, we have grown at least 28 syscalls that use timespecs in some
way, leading many programs both inside and outside of the base system to
redefine those macros. It's better just to make the definitions public.

Our kernel currently defines two-argument versions of timespecadd and
timespecsub.  NetBSD, OpenBSD, and FreeDesktop.org's libbsd, however, define
three-argument versions.  Solaris also defines a three-argument version, but
only in its kernel.  This revision changes our definition to match the
common three-argument version.

Bump _FreeBSD_version due to the breaking KPI change.

Discussed with:	cem, jilles, ian, bde
Differential Revision:	https://reviews.freebsd.org/D14725
</pre>
</div>
</content>
</entry>
</feed>
