From: sashiko-bot@kernel.org
To: "Nilesh Javali" <njavali@marvell.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v6 09/56] scsi: qla2xxx: Add 128-byte IOCB definitions for 29xx
Date: Thu, 23 Jul 2026 07:35:37 +0000 [thread overview]
Message-ID: <20260723073538.4287E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260723050413.3897522-10-njavali@marvell.com>
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] Endianness portability violation using bitfields on __le16 DMA structures.
- [Medium] Missing padding array leaves `struct vp_rpt_id_entry_24xx_ext` at 64 bytes instead of the required 128 bytes.
- [Medium] Possible truncation of 9-bit VP indices in `vp_config_entry_24xx_ext` and `vp_ctrl_entry_24xx_ext`.
- [Low] Stale comment in `struct sts_entry_24xx_ext` provides incorrect array offsets for DIF error handling.
--
--- Patch [9]: [PATCH v6 09/56] scsi: qla2xxx: Add 128-byte IOCB definitions for 29xx ---
commit f045d9bbc4916b8badfe0c3d725fe53a57f4cac2
Author: Anil Gurumurthy <agurumurthy@marvell.com>
scsi: qla2xxx: Add 128-byte IOCB definitions for 29xx
This commit introduces a new header file containing extended 128-byte IOCB
structure definitions for the QLogic 29xx series adapters. It maps the new
firmware interface to C structures for hardware DMA interactions.
> diff --git a/drivers/scsi/qla2xxx/qla_fw29.h b/drivers/scsi/qla2xxx/qla_fw29.h
> new file mode 100644
> index 0000000000000..efe1c60bee81d
> --- /dev/null
> +++ b/drivers/scsi/qla2xxx/qla_fw29.h
> @@ -0,0 +1,686 @@
[ ... ]
> +struct sts_entry_24xx_ext {
> + uint8_t entry_type; /* Entry type. */
> + uint8_t entry_count; /* Entry count. */
[ ... ]
> + uint8_t reserved_2[8];
> + uint8_t act_dif[8];
> + uint8_t exp_dif[8];
> + union {
[ ... ]
> + /*
> + * If DIF Error is set in comp_status, these additional fields are
> + * defined:
> + *
> + * !!! NOTE: Firmware sends expected/actual DIF data in big endian
> + * format; but all of the "data" field gets swab32-d in the beginning
> + * of qla2900_status_entry().
> + *
> + * &data[10] : uint8_t report_runt_bg[2]; - computed guard
> + * &data[12] : uint8_t actual_dif[8]; - DIF Data received
> + * &data[20] : uint8_t expected_dif[8]; - DIF Data computed
> + */
> +};
[Severity: Low]
Is this comment still accurate for the new 128-byte structure?
It appears this was copied from the legacy 64-byte struct. In this new layout,
the data array starts at offset 68, but the DIF error fields are explicitly
defined as act_dif[8] and exp_dif[8] at offsets 32 and 40.
Could this documentation mislead developers trying to access DIF error data?
[ ... ]
> +struct els_entry_24xx_ext {
> + uint8_t entry_type; /* Entry type. */
[ ... ]
> + __le16 tx_dsd_count;
> +
> + __le16 vp_index : 9; /* VP Index 9bits */
> + __le16 reserved_1_sof : 3;
> + __le16 sof_type : 4;
> +
> + __le32 rx_xchg_address; /* Receive exchange address. */
[Severity: High]
Can this cause endianness issues on big-endian architectures?
Since these structures map directly to hardware DMA buffers, compiler-dependent
C bitfield packing on __le16 variables could scramble the vp_index and sof_type
bits on big-endian hosts.
Would it be safer to use a plain __le16 field and define bitmask macros like
CMD_EXT_VP_INDEX_MASK, similar to what was done for cmd_type_crc_2_ext?
[ ... ]
> +struct els_sts_entry_24xx_ext {
> + uint8_t entry_type; /* Entry type. */
[ ... ]
> + __le16 reserved_1;
> +
> + __le16 vp_index : 9; /* VP Index 9bits */
> + __le16 reserved_1_sof : 3;
> + __le16 sof_type : 4;
> +
> + __le32 rx_xchg_address; /* Receive exchange address. */
[Severity: High]
Are these __le16 bitfields also susceptible to endianness packing issues across
different architectures?
[ ... ]
> +struct abts_entry_24xx_ext {
> + uint8_t entry_type;
> + uint8_t entry_count;
[ ... ]
> + __le16 control_flags; /* type 0x55 only */
> + __le16 vp_idx : 9; /* VP index 9 bits */
> + __le16 reserved_1_sof : 3;
> + __le16 sof_type : 4; /* sof_type is upper nibble */
> +
> + __le32 rx_xch_addr;
[Severity: High]
Do these bitfields have the same endianness concerns as the others?
[ ... ]
> +struct vp_ctrl_entry_24xx_ext {
> + uint8_t entry_type; /* Entry type. */
[ ... ]
> + __le16 command;
> +
> + __le16 vp_count;
> +
> + uint8_t vp_idx_map[16];
> + __le16 flags;
> + __le16 id;
[Severity: Medium]
Are these 8-bit map entries sufficient for a 9-bit virtual port index?
The rest of the 29xx extended structures expand the virtual port index to
9 bits to support up to 512 virtual ports. Will mapping these indices to
uint8_t fields silently truncate values above 255?
[ ... ]
> +struct vp_config_entry_24xx_ext {
> + uint8_t entry_type; /* Entry type. */
[ ... ]
> + uint8_t command;
> +
> + uint8_t vp_count;
> +
> + uint8_t vp_index1;
> + uint8_t vp_index2;
> +
> + uint8_t options_idx1;
[Severity: Medium]
Could this truncate the 9-bit virtual port indices?
If the 29xx hardware supports indices up to 511, storing them in these
uint8_t variables will drop the upper bit.
[ ... ]
> +struct vp_rpt_id_entry_24xx_ext {
> + uint8_t entry_type; /* Entry type. */
> + uint8_t entry_count; /* Entry count. */
> + uint8_t sys_define; /* System defined. */
> + uint8_t entry_status; /* Entry Status. */
> + __le32 resv1;
> + uint8_t vp_acquired;
> + uint8_t vp_setup;
> + __le16 vp_idx : 9; /* VP Index 9bits */
> + __le16 vp_status : 7; /* VP Status 7bits */
[Severity: High]
Do these bitfields have the same endianness concerns as the ones in
els_entry_24xx_ext?
[ ... ]
> + uint8_t port_name[8];
> + uint8_t node_name[8];
> + uint16_t bbcr;
> + uint8_t reserved_5[2];
> + uint8_t remote_nport_id[4];
> + } f2;
> + } u;
> +};
> +#endif
[Severity: Medium]
Does this structure meet the 128-byte size requirement?
Unlike the other extended structures which include a reserved padding array
at the end to ensure the struct size is exactly 128 bytes, this one appears
to omit the padding and end at 64 bytes.
If any queue logic relies on the size of this struct, could it miscalculate
strides or corrupt memory queues?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260723050413.3897522-1-njavali@marvell.com?part=9
next prev parent reply other threads:[~2026-07-23 7:35 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 5:03 [PATCH v6 00/56] scsi: qla2xxx: Add QLA29xx series adapter support Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 01/56] scsi: qla2xxx: Add 29xx series PCI device ID support Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 02/56] scsi: qla2xxx: Add flash read/write interface for 29xx Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 03/56] scsi: qla2xxx: Add NVRAM config support for 29xx adapters Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 04/56] scsi: qla2xxx: Add 29xx support in queue initialisation path Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 05/56] scsi: qla2xxx: Add FC operational firmware load for 29xx Nilesh Javali
2026-07-23 6:44 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 06/56] scsi: qla2xxx: Remove redundant VPD flash read in sysfs read path Nilesh Javali
2026-07-23 6:53 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 07/56] scsi: qla2xxx: Add flash block read/write BSG support for 29xx Nilesh Javali
2026-07-23 7:11 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 08/56] scsi: qla2xxx: Add BSG MPI firmware load/dump " Nilesh Javali
2026-07-23 7:24 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 09/56] scsi: qla2xxx: Add 128-byte IOCB definitions " Nilesh Javali
2026-07-23 7:35 ` sashiko-bot [this message]
2026-07-23 5:03 ` [PATCH v6 10/56] scsi: qla2xxx: Add extended status continuation and marker IOCBs Nilesh Javali
2026-07-23 7:43 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 11/56] scsi: qla2xxx: Update IO path to use 128-byte IOCBs for 29xx Nilesh Javali
2026-07-23 8:25 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 12/56] scsi: qla2xxx: Skip image-set-valid attribute " Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 13/56] scsi: qla2xxx: Skip unsupported sysfs attributes " Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 14/56] scsi: qla2xxx: Enable get_fw_version mailbox " Nilesh Javali
2026-07-23 9:15 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 15/56] scsi: qla2xxx: Extend execute_fw mailbox to include 29xx Nilesh Javali
2026-07-23 9:26 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 16/56] scsi: qla2xxx: Enable get_adapter_id mailbox for 29xx Nilesh Javali
2026-07-23 9:36 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 17/56] scsi: qla2xxx: Enable init_firmware " Nilesh Javali
2026-07-23 9:45 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 18/56] scsi: qla2xxx: Enable get_firmware_state " Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 19/56] scsi: qla2xxx: Enable serdes, resource count and FCE trace " Nilesh Javali
2026-07-23 10:10 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 20/56] scsi: qla2xxx: Enable set_els_cmds and echo_test " Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 21/56] scsi: qla2xxx: Add support for QLA29XX in data rate functions Nilesh Javali
2026-07-23 10:25 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 22/56] scsi: qla2xxx: Enable qla2x00_shutdown for 29xx Nilesh Javali
2026-07-23 10:34 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 23/56] scsi: qla2xxx: Use ring-slot helpers in __qla2x00_alloc_iocbs Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 24/56] scsi: qla2xxx: Add support for QLA29XX in memory allocation Nilesh Javali
2026-07-23 10:56 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 25/56] scsi: qla2xxx: Handle sts_cont_entry_ext_t for 29xx adapters Nilesh Javali
2026-07-23 11:12 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 26/56] scsi: qla2xxx: Update handling of status entries for 29xx series Nilesh Javali
2026-07-23 13:25 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 27/56] scsi: qla2xxx: Enhance ct_entry_24xx_ext iocb handling " Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 28/56] scsi: qla2xxx: Enhance purex_entry " Nilesh Javali
2026-07-23 14:09 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 29/56] scsi: qla2xxx: Update handling of ELS IOCBs " Nilesh Javali
2026-07-23 14:25 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 30/56] scsi: qla2xxx: Add size check for ELS status entry layout on 29xx Nilesh Javali
2026-07-23 14:39 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 31/56] scsi: qla2xxx: Add 29xx extended logio IOCB support Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 32/56] scsi: qla2xxx: Enhance task management IOCB handling for 29xx series Nilesh Javali
2026-07-23 15:08 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 33/56] scsi: qla2xxx: Add abort command " Nilesh Javali
2026-07-23 15:28 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 34/56] scsi: qla2xxx: Enhance ABTS processing " Nilesh Javali
2026-07-23 15:53 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 35/56] scsi: qla2xxx: Update VP control IOCB handling " Nilesh Javali
2026-07-23 16:12 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 36/56] scsi: qla2xxx: Add build-time size check for VP config IOCB layout Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 37/56] scsi: qla2xxx: Add size check for extended VP report ID entry Nilesh Javali
2026-07-23 16:31 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 38/56] scsi: qla2xxx: Add LS4 pass-through IOCB handling for 29xx series Nilesh Javali
2026-07-23 16:47 ` sashiko-bot
2026-07-23 5:03 ` [PATCH v6 39/56] scsi: qla2xxx: Adjust feature gating in BSG paths for 29xx support Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 40/56] scsi: qla2xxx: Fix queue teardown NULL dma_free and bitmap locking Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 41/56] scsi: qla2xxx: Replace __le16 bitfields with scalar and accessors Nilesh Javali
2026-07-23 5:03 ` [PATCH v6 42/56] scsi: qla2xxx: Fix endianness annotations in vp_rpt_id_entry structures Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 43/56] scsi: qla2xxx: Use 64-bit FPM word counters for 29xx host stats Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 44/56] scsi: qla2xxx: Add 64G/128G port speed setting support Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 45/56] scsi: qla2xxx: Fix 64G link speed reporting in get_data_rate Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 46/56] scsi: qla2xxx: edif: Fix NULL pointer deref in RX SA delete check Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 47/56] scsi: qla2xxx: Fix Name Server logout detection on FWI2 adapters Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 48/56] scsi: qla2xxx: Bound VP index against VP_CTRL IOCB bitmap size Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 49/56] scsi: qla2xxx: Check entry_status in qla24xx_modify_vp_config() Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 50/56] scsi: qla2xxx: Hold vport reference in qla24xx_report_id_acquisition() Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 51/56] scsi: qla2xxx: Initialize NVMe abort_work once at submission Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 52/56] scsi: qla2xxx: Hold qpair lock when sending NVMe LS reject Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 53/56] scsi: qla2xxx: Zero dport diagnostics buffer to avoid info leak Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 54/56] scsi: qla2xxx: Fix BSG job leak on validate flash image error path Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 55/56] scsi: qla2xxx: Bound image count in qla2x00_update_fru_versions() Nilesh Javali
2026-07-23 5:04 ` [PATCH v6 56/56] scsi: qla2xxx: Update version to 12.00.00.2607b1 Nilesh Javali
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260723073538.4287E1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=njavali@marvell.com \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox