From: Tyrel Datwyler <tyreld@linux.ibm.com>
To: davemarq@linux.ibm.com,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, Brian King <brking@linux.ibm.com>,
Greg Joyce <gjoyce@linux.ibm.com>,
Kyle Mahlkuch <kmahlkuc@linux.ibm.com>
Subject: Re: [PATCH v2 7/7] ibmvfc: handle extended FPIN events
Date: Mon, 15 Jun 2026 14:52:54 -0700 [thread overview]
Message-ID: <5ab40307-b197-4a19-ac73-5f7e516d81b8@linux.ibm.com> (raw)
In-Reply-To: <20260608-ibmvfc-fpin-support-v2-7-d41f540fba5c@linux.ibm.com>
On 6/8/26 11:30 AM, Dave Marquardt via B4 Relay wrote:
> From: Dave Marquardt <davemarq@linux.ibm.com>
>
> Add extended FPIN handling to ibmvfc driver. Tell VIOS ibmvfc can
> handle extended FPIN messages, convert any received to struct fc_els
> descriptors, and call fc_host_fpin_rcv to update statistics and send
> netlink multicast messages to listeners such as multipathd.
> ---
> drivers/scsi/ibmvscsi/ibmvfc.c | 41 +++++++++++-
> drivers/scsi/ibmvscsi/ibmvfc.h | 31 +++++++++
> drivers/scsi/ibmvscsi/ibmvfc_kunit.c | 122 +++++++++++++++++++++++++++++++++--
> 3 files changed, 186 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
> index a2252cd2f44b..b034a894e3ec 100644
> --- a/drivers/scsi/ibmvscsi/ibmvfc.c
> +++ b/drivers/scsi/ibmvscsi/ibmvfc.c
> @@ -1515,7 +1515,8 @@ static void ibmvfc_set_login_info(struct ibmvfc_host *vhost)
> login_info->capabilities =
> cpu_to_be64(IBMVFC_CAN_MIGRATE | IBMVFC_CAN_SEND_VF_WWPN |
> IBMVFC_CAN_USE_NOOP_CMD | IBMVFC_YES_SCSI |
> - IBMVFC_USE_ASYNC_SUBQ | IBMVFC_CAN_HANDLE_FPIN);
> + IBMVFC_USE_ASYNC_SUBQ | IBMVFC_CAN_HANDLE_FPIN |
> + IBMVFC_CAN_HANDLE_FPIN_EXT);
>
> if (vhost->mq_enabled || vhost->using_channels)
> login_info->capabilities |= cpu_to_be64(IBMVFC_CAN_USE_CHANNELS);
> @@ -3254,7 +3255,7 @@ ibmvfc_common_fpin_to_desc(u8 fpin_status, __be64 wwpn, __be16 type, __be16 modi
> if (size == 0)
> return NULL;
>
> - fpin = kzalloc(size, GFP_ATOMIC);
> + fpin = kzalloc(size, GFP_KERNEL);
I commented on why this was changed in the previous patch, but now its been
reverted back here. Looks like a refactoring artifact that needs to be fixed in
patch 6.
> if (fpin == NULL)
> return NULL;
>
> @@ -3371,6 +3372,28 @@ ibmvfc_full_fpin_to_desc(struct ibmvfc_async_subq *ibmvfc_fpin)
> cpu_to_be32(1));
> }
>
> +/**
> + * ibmvfc_ext_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_ext_fpin_to_desc(struct ibmvfc_async_subq_fpin *ibmvfc_fpin)
> +{
> + return ibmvfc_common_fpin_to_desc(ibmvfc_fpin->fpin_status, ibmvfc_fpin->wwpn,
> + ibmvfc_fpin->fpin_data.event_type,
> + ibmvfc_fpin->fpin_data.event_type_modifier,
> + ibmvfc_fpin->fpin_data.event_threshold,
> + ibmvfc_fpin->fpin_data.event_data.event_count);
> +}
> +
> /**
> * ibmvfc_process_async_work - Process IBMVFC_AE_FPIN async CRQ from work queue
> * @work: pointer to work_struct
> @@ -3425,7 +3448,19 @@ static void ibmvfc_process_async_work(struct work_struct *work)
> fpin = ibmvfc_basic_fpin_to_desc(crq, tgt->wwpn);
> } else {
> sqfpin = (struct ibmvfc_async_subq_fpin *)subq;
> - fpin = ibmvfc_full_fpin_to_desc(subq);
I think this should be fpin = NULL here.
> + if ((subq->flags & IBMVFC_ASYNC_IS_FPIN_EXT) == 0) {
> + fpin = ibmvfc_full_fpin_to_desc(subq);
As you set it here for non-EXT fpins.
> + } else if (!(sqfpin->fpin_data.flags & IBMVFC_FPIN_EVENT_TYPE_VALID)) {
> + dev_err_ratelimited(vhost->dev,
> + "Invalid extended FPIN event received");
> + fpin = NULL;
No longer need to set NULL here
> + } else if (!ibmvfc_check_caps(vhost, IBMVFC_SUPPORT_FPIN_EXT)) {
> + dev_err_ratelimited(vhost->dev,
> + "Unexpected extended FPIN event received");
> + fpin = NULL;
Or here.
> + } else {
> + fpin = ibmvfc_ext_fpin_to_desc(sqfpin);
And here you set the ext-fpin case.
-Tyrel
prev parent reply other threads:[~2026-06-15 21:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 18:30 [PATCH v2 0/7] ibmvfc: make ibmvfc support FPIN messages Dave Marquardt via B4 Relay
2026-06-08 18:30 ` [PATCH v2 1/7] ibmvfc: add basic FPIN support Dave Marquardt via B4 Relay
2026-06-12 22:35 ` Tyrel Datwyler
2026-06-15 20:37 ` Dave Marquardt
2026-06-15 22:10 ` Tyrel Datwyler
2026-06-15 23:38 ` Tyrel Datwyler
2026-06-08 18:30 ` [PATCH v2 2/7] ibmvfc: Add NOOP command support Dave Marquardt via B4 Relay
2026-06-08 18:30 ` [PATCH v2 3/7] ibmvfc: make ibmvfc login to fabric Dave Marquardt via B4 Relay
2026-06-12 23:11 ` Tyrel Datwyler
2026-06-15 13:42 ` Dave Marquardt
2026-06-08 18:30 ` [PATCH v2 4/7] ibmvfc: define asynchronous sub-queue Dave Marquardt via B4 Relay
2026-06-15 19:27 ` Tyrel Datwyler
2026-06-15 20:15 ` Dave Marquardt
2026-06-08 18:30 ` [PATCH v2 5/7] ibmvfc: allocate " Dave Marquardt via B4 Relay
2026-06-15 19:54 ` Tyrel Datwyler
2026-06-08 18:30 ` [PATCH v2 6/7] ibmvfc: register and use " Dave Marquardt via B4 Relay
2026-06-15 20:58 ` Tyrel Datwyler
2026-06-08 18:30 ` [PATCH v2 7/7] ibmvfc: handle extended FPIN events Dave Marquardt via B4 Relay
2026-06-15 21:52 ` Tyrel Datwyler [this message]
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=5ab40307-b197-4a19-ac73-5f7e516d81b8@linux.ibm.com \
--to=tyreld@linux.ibm.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=brking@linux.ibm.com \
--cc=chleroy@kernel.org \
--cc=davemarq@linux.ibm.com \
--cc=gjoyce@linux.ibm.com \
--cc=kmahlkuc@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=martin.petersen@oracle.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.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