<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/isp/ispmbox.h, branch releng/13.4</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>Fix the isp(4) driver with 9.x firmware.</title>
<updated>2024-07-16T20:08:52+00:00</updated>
<author>
<name>Kenneth D. Merry</name>
<email>ken@FreeBSD.org</email>
</author>
<published>2024-06-21T19:30:59+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4c94657e168de3f45a423d65289b349fa7d69206'/>
<id>4c94657e168de3f45a423d65289b349fa7d69206</id>
<content type='text'>
The isp(4) driver (and ispfw(4) firmware) previously only included
firmware for Qlogic controllers up to 8Gb.  It recently gained
firmware for the 27XX and 28XX series controllers along with
improved firmware loading capabilities.

The 9.x firmware available for the 27XX and 28XX controllers in
ispfw(4) adds login state for NVMe devices in the top nibble of
the login state in the port database (isp_pdb_24xx_t in ispmbox.h).

This breaks the check at the end of isp_getpdb() to make sure the
device is in the right login state.  As a result, it breaks device
discovery for many (perhaps all?) FC devices.  In my testing with
IBM LTO-6 drives attached to a quad port 16Gb Qlogic 2714, they
don't show up when they are directly connected (and in loop mode)
or connected via a switch (and in fabric mode).

So, mask off the top bits of of the login state before checking it.
This shouldn't break anything, because all of the existing login
states defined in ispmbox.h are in the low nibble.

sys/dev/isp/ispmbox.h:
	Add a FCP login state mask define, and a NVMe login state
	shift.

sys/dev/isp/isp.c:
	In isp_getpdb(), make sure we're only looking at the FCP
	login state bits when we try to determine whether a device
	is in the right login state.

MFC after:	1 week
Sponsored by:	Spectra Logic
Reviewed by:	mav
Differential Revision:	&lt;https://reviews.freebsd.org/D45660&gt;

(cherry picked from commit 137b004e2b7ab504abf98c4aad9d52607df47b9a)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The isp(4) driver (and ispfw(4) firmware) previously only included
firmware for Qlogic controllers up to 8Gb.  It recently gained
firmware for the 27XX and 28XX series controllers along with
improved firmware loading capabilities.

The 9.x firmware available for the 27XX and 28XX controllers in
ispfw(4) adds login state for NVMe devices in the top nibble of
the login state in the port database (isp_pdb_24xx_t in ispmbox.h).

This breaks the check at the end of isp_getpdb() to make sure the
device is in the right login state.  As a result, it breaks device
discovery for many (perhaps all?) FC devices.  In my testing with
IBM LTO-6 drives attached to a quad port 16Gb Qlogic 2714, they
don't show up when they are directly connected (and in loop mode)
or connected via a switch (and in fabric mode).

So, mask off the top bits of of the login state before checking it.
This shouldn't break anything, because all of the existing login
states defined in ispmbox.h are in the low nibble.

sys/dev/isp/ispmbox.h:
	Add a FCP login state mask define, and a NVMe login state
	shift.

sys/dev/isp/isp.c:
	In isp_getpdb(), make sure we're only looking at the FCP
	login state bits when we try to determine whether a device
	is in the right login state.

MFC after:	1 week
Sponsored by:	Spectra Logic
Reviewed by:	mav
Differential Revision:	&lt;https://reviews.freebsd.org/D45660&gt;

(cherry picked from commit 137b004e2b7ab504abf98c4aad9d52607df47b9a)
</pre>
</div>
</content>
</entry>
<entry>
<title>isp(4): Rework firmware handling/loading</title>
<updated>2024-01-19T16:52:40+00:00</updated>
<author>
<name>Joerg Pulz</name>
<email>Joerg.Pulz@frm2.tum.de</email>
</author>
<published>2023-10-27T15:27:37+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=84f8cfcbe493dbbb657bb937fc1db47d5a8101ee'/>
<id>84f8cfcbe493dbbb657bb937fc1db47d5a8101ee</id>
<content type='text'>
Correctly identify the active firmware in flash on adapters with
primary and secondary firmware region in flash.
Correctly identify the active NVRAM on adapters with primary
and secondary NVRAM region in flash.

Loading ispfw(4) moved from isp_pci_attach() to isp_reset().
Drop the reference to ispfw(4) after using it so one can kldunload(8) it.
New isp_load_ram() function to load either ispfw(4) or flash firmware
into RISC's RAM.
New functions to read data from flash. The old ones will be removed later.
A bunch of new helper functions to identify and validate active flash
regions for firmware, auxiliary and NVRAM.
Overhaul ISP_FW_* macros and make use of it when comparing firmware
versions. We can handle firmware versions up to 255.255.255.

Firmware load priority slightly changed:
For 27xx and newer adapters:
- load ispfw(4) firmware
- request (active) flash firmware information
- compare version numbers of ispfw(4) and flash firmware
- load firmware with highest version into RISC's RAM
- if loading ispfw(4) is disabled or failed - load firmware from flash
- if everything else fails use MBOX_LOAD_FLASH_FIRMWARE as fallback

For 26xx and older adapters nothing changed:
- load ispfw(4) firmware and load it into RISC's RAM
- if loading ispfw(4) is disabled or failed use MBOX_EXEC_FIRMWARE
- for 26xx a preceding MBOX_LOAD_FLASH_FIRMWARE is used

New read only sysctl(8)'s:
 dev.isp.N.fw_version_run: the firmware version actually running
 dev.isp.N.fw_version_ispfw: the firmware version provided by ispfw(4)
 dev.isp.N.fw_version_flash: the (active) firmware version in flash

While here:
  - firmware attribute handling/parsing reworked
    + renamed defines from ISP2400_FW_ATTR_* to ISP_FW_ATTR_*
    + changed values to match new handling/parsing
    + added some more attributes
  - enable FLT support on 26xx based adapters
  - log level adjustments
  - new function return status codes (some for now, some for later use)
  - some minor style changes

Tested and approved to work on real hardware with:
  - Qlogic ISP 2532 (QLogic QLE2560 8Gb FC Adapter)
  - Qlogic ISP 2031 (QLogic QLE2662 16Gbit 2Port FC Adapter)
  - Qlogic ISP 2722 (QLogic QLE2690 16Gb FC Adapter)
  - Qlogic ISP 2812 (QLogic QLE2772 32Gbit 2Port FC Adapter)

PR:		273263
Reviewed by:	mav
Pull Request:	https://github.com/freebsd/freebsd-src/pull/877
MFC after:	1 month
Sponsored by:	Technical University of Munich

(cherry picked from commit 10ed63fc06cb9902cc783ce8d0086c9aa97ed1e1)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Correctly identify the active firmware in flash on adapters with
primary and secondary firmware region in flash.
Correctly identify the active NVRAM on adapters with primary
and secondary NVRAM region in flash.

Loading ispfw(4) moved from isp_pci_attach() to isp_reset().
Drop the reference to ispfw(4) after using it so one can kldunload(8) it.
New isp_load_ram() function to load either ispfw(4) or flash firmware
into RISC's RAM.
New functions to read data from flash. The old ones will be removed later.
A bunch of new helper functions to identify and validate active flash
regions for firmware, auxiliary and NVRAM.
Overhaul ISP_FW_* macros and make use of it when comparing firmware
versions. We can handle firmware versions up to 255.255.255.

Firmware load priority slightly changed:
For 27xx and newer adapters:
- load ispfw(4) firmware
- request (active) flash firmware information
- compare version numbers of ispfw(4) and flash firmware
- load firmware with highest version into RISC's RAM
- if loading ispfw(4) is disabled or failed - load firmware from flash
- if everything else fails use MBOX_LOAD_FLASH_FIRMWARE as fallback

For 26xx and older adapters nothing changed:
- load ispfw(4) firmware and load it into RISC's RAM
- if loading ispfw(4) is disabled or failed use MBOX_EXEC_FIRMWARE
- for 26xx a preceding MBOX_LOAD_FLASH_FIRMWARE is used

New read only sysctl(8)'s:
 dev.isp.N.fw_version_run: the firmware version actually running
 dev.isp.N.fw_version_ispfw: the firmware version provided by ispfw(4)
 dev.isp.N.fw_version_flash: the (active) firmware version in flash

While here:
  - firmware attribute handling/parsing reworked
    + renamed defines from ISP2400_FW_ATTR_* to ISP_FW_ATTR_*
    + changed values to match new handling/parsing
    + added some more attributes
  - enable FLT support on 26xx based adapters
  - log level adjustments
  - new function return status codes (some for now, some for later use)
  - some minor style changes

Tested and approved to work on real hardware with:
  - Qlogic ISP 2532 (QLogic QLE2560 8Gb FC Adapter)
  - Qlogic ISP 2031 (QLogic QLE2662 16Gbit 2Port FC Adapter)
  - Qlogic ISP 2722 (QLogic QLE2690 16Gb FC Adapter)
  - Qlogic ISP 2812 (QLogic QLE2772 32Gbit 2Port FC Adapter)

PR:		273263
Reviewed by:	mav
Pull Request:	https://github.com/freebsd/freebsd-src/pull/877
MFC after:	1 month
Sponsored by:	Technical University of Munich

(cherry picked from commit 10ed63fc06cb9902cc783ce8d0086c9aa97ed1e1)
</pre>
</div>
</content>
</entry>
<entry>
<title>isp(4): Add support for QLogic 28xx devices</title>
<updated>2024-01-19T16:51:45+00:00</updated>
<author>
<name>Joerg Pulz</name>
<email>Joerg.Pulz@frm2.tum.de</email>
</author>
<published>2023-07-07T21:43:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=6fdabe9b8df4493af8242fb2755b69e20d1ef042'/>
<id>6fdabe9b8df4493af8242fb2755b69e20d1ef042</id>
<content type='text'>
This covers the following HBAs:
  ISP2812-based 64/32G Fibre Channel to PCIe Controller:
    QLE2770 Single Port 32GFC PCIe Gen4 x8 Adapter
    QLE2772 Dual Port 32GFC PCIe Gen4 x8 Adapter
    QLE2870 Single Port 64GFC PCIe Gen4 x8 Adapter
    QLE2872 Dual Port 64GFC PCIe Gen4 x8 Adapter

  ISP2814-based 64/32G Fibre Channel to PCIe Controller:
    QLE2774 Quad Port 32GFC PCIe Gen4 x16 Adapter
    QLE2874 Quad Port 64GFC PCIe Gen4 x16 Adapter

While here, add required bits to support 64GB FC.

Default framesize is set to 2048 for ISP28xx based HBAs for now.

PR: 271062
Reviewed by: imp, mav
Sponsored by: Technical University of Munich
Pull Request: https://github.com/freebsd/freebsd-src/pull/726

(cherry picked from commit 407abff6a445c8db335093868e9e7e70438c5901)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This covers the following HBAs:
  ISP2812-based 64/32G Fibre Channel to PCIe Controller:
    QLE2770 Single Port 32GFC PCIe Gen4 x8 Adapter
    QLE2772 Dual Port 32GFC PCIe Gen4 x8 Adapter
    QLE2870 Single Port 64GFC PCIe Gen4 x8 Adapter
    QLE2872 Dual Port 64GFC PCIe Gen4 x8 Adapter

  ISP2814-based 64/32G Fibre Channel to PCIe Controller:
    QLE2774 Quad Port 32GFC PCIe Gen4 x16 Adapter
    QLE2874 Quad Port 64GFC PCIe Gen4 x16 Adapter

While here, add required bits to support 64GB FC.

Default framesize is set to 2048 for ISP28xx based HBAs for now.

PR: 271062
Reviewed by: imp, mav
Sponsored by: Technical University of Munich
Pull Request: https://github.com/freebsd/freebsd-src/pull/726

(cherry picked from commit 407abff6a445c8db335093868e9e7e70438c5901)
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c comment pattern</title>
<updated>2023-08-23T17:43:22+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:31:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4fbf14e22d7b83de7080a8e491ba14a5785a0ff4'/>
<id>4fbf14e22d7b83de7080a8e491ba14a5785a0ff4</id>
<content type='text'>
Remove /^/[*/]\s*\$FreeBSD\$.*\n/

Similar commit in current:
(cherry picked from commit 71625ec9ad2a)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^/[*/]\s*\$FreeBSD\$.*\n/

Similar commit in current:
(cherry picked from commit 71625ec9ad2a)
</pre>
</div>
</content>
</entry>
<entry>
<title>spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD</title>
<updated>2023-07-25T15:13:49+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-05-10T15:40:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=caa41f641755c935b036e17440a3b49329c904ed'/>
<id>caa41f641755c935b036e17440a3b49329c904ed</id>
<content type='text'>
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix

(cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix

(cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
</pre>
</div>
</content>
</entry>
<entry>
<title>ips(4): Remove a double word in a few source code comments</title>
<updated>2022-04-14T06:11:01+00:00</updated>
<author>
<name>Gordon Bergling</name>
<email>gbe@FreeBSD.org</email>
</author>
<published>2022-04-09T08:53:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=49a2f75623f201559b2ccd20d434a15c82f99969'/>
<id>49a2f75623f201559b2ccd20d434a15c82f99969</id>
<content type='text'>
- s/for for/for/

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

(cherry picked from commit bafe4cee3db4846f443241be9f995d72347c3647)
</pre>
</div>
</content>
</entry>
<entry>
<title>Some code reorganization.</title>
<updated>2020-11-27T15:50:20+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2020-11-27T15:50:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=156c1ebe3bc4ec8063790ed9c8d46ce00903cee4'/>
<id>156c1ebe3bc4ec8063790ed9c8d46ce00903cee4</id>
<content type='text'>
 - Remove code duplication by adding two new functions to execute prepared
queue entry via either mbox or request queue and wait for result.
 - Since the new function executing via request queue sleeps any way, make
it sleep also in case of overflows or handle shortages.  It should make it
more reliable and less affecting other less flexible request queue users.
 - Turn isp_target_put_entry() into not target-specific isp_send_entry().
 - Make handling of responses with control handles more universal.
 - Move RQSTYPE_RPT_ID_ACQ handling into new function.
 - Inline isp_handle_other_response(), becoming trivial after above.
 - Clean the list of IOCBs from pre-24xx ones.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 - Remove code duplication by adding two new functions to execute prepared
queue entry via either mbox or request queue and wait for result.
 - Since the new function executing via request queue sleeps any way, make
it sleep also in case of overflows or handle shortages.  It should make it
more reliable and less affecting other less flexible request queue users.
 - Turn isp_target_put_entry() into not target-specific isp_send_entry().
 - Make handling of responses with control handles more universal.
 - Move RQSTYPE_RPT_ID_ACQ handling into new function.
 - Inline isp_handle_other_response(), becoming trivial after above.
 - Clean the list of IOCBs from pre-24xx ones.
</pre>
</div>
</content>
</entry>
<entry>
<title>More cleanup in response queue and reset code.</title>
<updated>2020-11-26T18:47:23+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2020-11-26T18:47:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b760d2eca9862883f6e9094c5e28e65d1e925d9a'/>
<id>b760d2eca9862883f6e9094c5e28e65d1e925d9a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Some minor FCoE bits I had lying around.</title>
<updated>2020-11-26T02:14:52+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2020-11-26T02:14:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b05f17a12fc58914e0a5b17f90331627b600432d'/>
<id>b05f17a12fc58914e0a5b17f90331627b600432d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update RQSFLAG_* definitions.</title>
<updated>2020-11-24T17:37:12+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2020-11-24T17:37:12+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5bcbd98c8bea0119ef0b0521d8a2709078dcecda'/>
<id>5bcbd98c8bea0119ef0b0521d8a2709078dcecda</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
