Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tyrel Datwyler" <tyreld@linux.ibm.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v11 07/11] scsi: ibmvfc: extend async event handlers for async sub-CRQ events
Date: Fri, 25 Sep 2026 05:00:23 +0000	[thread overview]
Message-ID: <20260925050023.8E5481F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260925044900.414340-8-tyreld@linux.ibm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] scsi: ibmvfc: FPIN descriptor uses potentially unpopulated WWPN from sub-CRQ
--

commit 8a1ab5ee327462636518cdba29b91df0f867bb9f
Author: Dave Marquardt <davemarq@linux.ibm.com>

scsi: ibmvfc: extend async event handlers for async sub-CRQ events

This commit refactors async event handling to support both traditional async
CRQs and new asynchronous sub-queue CRQs. It introduces a tagged union that
wraps the async event and dispatches processing based on event type.

> diff --git a/drivers/scsi/ibmvscsi/ibmvfc-core.c b/drivers/scsi/ibmvscsi/ibmvfc-core.c
> index f465efadc02c8..321bb2f7219ed 100644
> --- a/drivers/scsi/ibmvscsi/ibmvfc-core.c
> +++ b/drivers/scsi/ibmvscsi/ibmvfc-core.c
> @@ -3426,6 +3426,45 @@ ibmvfc_basic_fpin_to_desc(struct ibmvfc_async_crq *crq, u64 wwpn)
>  					  cpu_to_be32(1));
>  }
>  
> +/**
> + * ibmvfc_full_fpin_to_desc(): allocate and populate a struct fc_els_fpin struct
> + * containing a descriptor.
> + * @ibmvfc_fpin: Pointer to async subq FPIN data
> + *
> + * Allocate a struct fc_els_fpin containing a descriptor and populate
> + * based on data from *ibmvfc_fpin.
> + *
> + * Return:
> + * NULL     - unable to allocate structure
> + * non-NULL - pointer to populated struct fc_els_fpin
> + */
> +static struct fc_els_fpin *
> +ibmvfc_full_fpin_to_desc(struct ibmvfc_async_sub_crq *ibmvfc_fpin)
> +{
> +	__be16 type;

[ ... ]

> +	return ibmvfc_common_fpin_to_desc(ibmvfc_fpin->fpin_status, ibmvfc_fpin->wwpn,
> +					  type, cpu_to_be16(0),
> +					  cpu_to_be32(IBMVFC_FPIN_DEFAULT_EVENT_THRESHOLD),
> +					  cpu_to_be32(1));
> +}

[ ... ]

> @@ -3463,28 +3502,40 @@ static struct ibmvfc_target *ibmvfc_find_target(struct list_head *target_list,
>   */
>  static void ibmvfc_process_async_work(struct work_struct *work)
>  {

[ ... ]

> @@ -3496,7 +3547,11 @@ static void ibmvfc_process_async_work(struct work_struct *work)
>  		goto free;
>  	}
>  
> -	fpin = ibmvfc_basic_fpin_to_desc(crq, tgt->wwpn);
> +	if (crq)
> +		fpin = ibmvfc_basic_fpin_to_desc(crq, tgt->wwpn);
> +	else
> +		fpin = ibmvfc_full_fpin_to_desc(subq);
> +

[Severity: Medium]
If the hardware sends an async sub-CRQ FPIN event lacking a WWPN but
providing a valid node_name or scsi_id, the driver successfully resolves
the target (tgt) earlier in this function. 

However, ibmvfc_full_fpin_to_desc() uses subq->wwpn instead of the resolved
tgt->wwpn. Could this generate an FPIN descriptor with a zero attached WWPN,
causing fc_host_fpin_rcv() to fail to match the target's rport and drop the
congestion statistics update?

The legacy CRQ path safely passes tgt->wwpn via ibmvfc_basic_fpin_to_desc().
Should ibmvfc_full_fpin_to_desc() be updated to also take tgt->wwpn?

>  	if (fpin) {
>  		fc_host_fpin_rcv(tgt->vhost->host,
>  				 sizeof(*fpin) + be32_to_cpu(fpin->desc_len),

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260925044900.414340-1-tyreld@linux.ibm.com?part=7

  reply	other threads:[~2026-09-25  5:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25  4:48 [PATCH v11 00/11] scsi: ibmvfc: make ibmvfc support FPIN messages Tyrel Datwyler
2026-09-25  4:48 ` [PATCH v11 01/11] scsi: ibmvfc: fix IRQ leak and guard deregister on channel reg failure Tyrel Datwyler
2026-09-25  4:48 ` [PATCH v11 02/11] scsi: ibmvfc: fix potential clobbering of rc after failed irq setup Tyrel Datwyler
2026-09-25  4:48 ` [PATCH v11 03/11] scsi: ibmvfc: fix potential NULL pointer dereference on failed queue allocation Tyrel Datwyler
2026-09-25  4:48 ` [PATCH v11 04/11] scsi: ibmvfc: add basic FPIN support Tyrel Datwyler
2026-09-25  5:03   ` sashiko-bot
2026-09-25 16:16     ` Dave Marquardt
2026-09-25 16:36       ` Dave Marquardt
2026-09-28 14:11         ` Dave Marquardt
2026-09-25  4:48 ` [PATCH v11 05/11] scsi: ibmvfc: add NOOP command support Tyrel Datwyler
2026-09-25  4:48 ` [PATCH v11 06/11] scsi: ibmvfc: add FPIN extended flag and async sub-CRQ queue handle Tyrel Datwyler
2026-09-25  4:48 ` [PATCH v11 07/11] scsi: ibmvfc: extend async event handlers for async sub-CRQ events Tyrel Datwyler
2026-09-25  5:00   ` sashiko-bot [this message]
2026-09-28 15:45     ` Dave Marquardt
2026-09-25  4:48 ` [PATCH v11 08/11] scsi: ibmvfc: add interrupt routine for asynchronous sub CRQ Tyrel Datwyler
2026-09-25  4:48 ` [PATCH v11 09/11] scsi: ibmvfc: extend channel reg/dereg helpers for async sub-CRQ Tyrel Datwyler
2026-09-25  5:05   ` sashiko-bot
2026-09-28 15:55     ` Dave Marquardt
2026-09-25  4:48 ` [PATCH v11 10/11] scsi: ibmvfc: register and use asynchronous sub CRQ for events Tyrel Datwyler
2026-09-25  5:09   ` sashiko-bot
2026-09-28 22:30     ` Dave Marquardt
2026-09-29 15:33       ` Tyrel Datwyler
2026-09-25  4:49 ` [PATCH v11 11/11] scsi: ibmvfc: handle extended FPIN events Tyrel Datwyler

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=20260925050023.8E5481F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tyreld@linux.ibm.com \
    /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