]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r348247:
authorken <ken@FreeBSD.org>
Fri, 31 May 2019 20:36:32 +0000 (20:36 +0000)
committerken <ken@FreeBSD.org>
Fri, 31 May 2019 20:36:32 +0000 (20:36 +0000)
commit38c430a8135d09d77bd59c253f8fb1f92dacd109
tree0150b91b8e9125bdf3377b37cbec75eaa2c9a2bf
parent04a501c3f4ee2fa4ba747b9845965837361cee19
MFC r348247:
  ------------------------------------------------------------------------
  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
Approved by: re (gjb)
sys/dev/isp/isp.c
sys/dev/isp/isp_freebsd.c