From nobody Fri Oct 2 01:10:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13D01365A14; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; cv=none; b=lrxkgsq/cjn4mrR0kkS2+r9fPU47zo6jt11J83YxDa7aYfWTM85XrAoe82IwP2g4V28O28togFwsRLzUqe+leirezjGZeRg17EVQ88jgzd1flC4Hzpy/cjllxqfP30gz1FkShM8Goer+I7tlvT3Swx/LtWyTAH2InRu9fMjmOlY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; c=relaxed/simple; bh=pbE7Bd34ry3odJJi1qlcv+RuoVta/ea88tc8fwk2CHc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZsYBcWevlmRs7NIJedInI9floQHpe4KQw387zqmlDZ90Npj1FM+soCOc+nHTfDmKMNVwb4XBnHrhvauL/K4+1Bd58H3ZDYTqdborRYaQEt1e4gFmzSr3Yas5QPkRwElPpDZKj//i2Y3nW8J+kHeyerGNALyGJ4MdIXXo9QaafpE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PAObS/rw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PAObS/rw" Received: by smtp.kernel.org (Postfix) with ESMTPS id 9DF03C2BCF5; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1786029460; bh=pbE7Bd34ry3odJJi1qlcv+RuoVta/ea88tc8fwk2CHc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=PAObS/rw24nMcii24aJavQuHJEV/YBUc020XaB48D/kHuzH6Fu3FhQePY05q4H7pz 9EjcELaMmMay/yqNfc8QqA5cb8KLchpYFV2TWnpN+gwPmowpuo0Wo+9JRg+tniF12I 6212E/Oi5kLHF/P2zIh6EHb+BEg3pWETro74AC60/M/JNjJkN658VWrOYnQUGiG2W0 kgIEfCXYR8dOi02Cw7oy16+1JPU1as2k160yvFhmNp0b1TaQNmhHJ/xJjlL5FMNI70 7nlshy1362QGhwTtrsFXbI2ceJ6hjyAN3LlcbZSEaqSbyuOqy5yzwu1f2ugD5brpkj /yzDbfQ1K6fmw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DAF6C56207; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) From: Dave Marquardt via B4 Relay Date: Thu, 06 Aug 2026 10:17:31 -0500 Subject: [PATCH v5 1/7] scsi: ibmvfc: add basic FPIN support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260806-ibmvfc-fpin-support-v5-1-13fd6f8a8f8b@linux.ibm.com> References: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> In-Reply-To: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> To: "James E.J. Bottomley" , "Martin K. Petersen" , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Tyrel Datwyler Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Brian King , Greg Joyce , Kyle Mahlkuch , Dave Marquardt X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1786029459; l=21096; i=davemarq@linux.ibm.com; s=20260216; h=from:subject:message-id; bh=u9WAEDxz4h931KeG4UjRvz5O6SDnU3Rh0zMtoV3tjJ8=; b=RXZt7U2Cr0tnba9OLbzKEpxSBRon76iEw8R6TKu8uP+jvE+X0A+sCRjObpwW8tvTZb5qYh2T7 8TMY5gDHLlWASraw0dLaq2xSLDpU13KpoXazkOfWSVcmMQuDBzIBpAr X-Developer-Key: i=davemarq@linux.ibm.com; a=ed25519; pk=vy0/nfobrje6EqZxuyw6a3ZstytG8WK2vf5Y3xtGrEg= X-Endpoint-Received: by B4 Relay for davemarq@linux.ibm.com/20260216 with auth_id=689 X-Original-From: Dave Marquardt Reply-To: davemarq@linux.ibm.com From: Dave Marquardt Implement support for a basic level of Fabric Performance Impact Notifications (FPIN) in the ibmvfc driver to enable monitoring of fabric congestion and link integrity events. Add async event handler for IBMVFC_AE_FPIN events that offloads FPIN processing to a dedicated workqueue. Convert VIOS FPIN messages to standard fc_els_fpin structures and pass them to fc_host_fpin_rcv() for processing by the FC transport layer. Introduce common FPIN conversion routines that will be reused for full and extended FPIN support in subsequent patches. Add KUnit test infrastructure to validate FPIN event handling and statistics updates. Changes include: - Add FPIN async event handling in ibmvfc_handle_async() - Create dedicated workqueue for FPIN processing - Implement FPIN message conversion to fc_els_fpin format - Add support for link congestion, port congestion, port cleared, port degraded, and congestion cleared events - Add KUnit test module for FPIN functionality Signed-off-by: Dave Marquardt --- drivers/scsi/Kconfig | 10 ++ drivers/scsi/ibmvscsi/Makefile | 1 + drivers/scsi/ibmvscsi/ibmvfc-core.c | 270 +++++++++++++++++++++++++++++++= +++- drivers/scsi/ibmvscsi/ibmvfc.h | 16 +++ drivers/scsi/ibmvscsi/ibmvfc_kunit.c | 130 +++++++++++++++++ 5 files changed, 424 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 4a2af0f702e1..352abe10da58 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig @@ -759,6 +759,16 @@ config SCSI_IBMVFC To compile this driver as a module, choose M here: the module will be called ibmvfc. =20 +config SCSI_IBMVFC_KUNIT_TEST + tristate "KUnit tests for the IBM POWER Virtual FC Client" if !KUNIT_ALL_= TESTS + depends on SCSI_IBMVFC && KUNIT + default KUNIT_ALL_TESTS + help + Compile IBM POWER Virtual FC client KUnit tests. These tests + specifically test FPIN functionality. To compile this driver + as a module, choose M here: the module will be called + ibmvfc_kunit. + config SCSI_IBMVFC_TRACE bool "enable driver internal trace" depends on SCSI_IBMVFC diff --git a/drivers/scsi/ibmvscsi/Makefile b/drivers/scsi/ibmvscsi/Makefile index 9408c7f4cdee..a227bc633f3a 100644 --- a/drivers/scsi/ibmvscsi/Makefile +++ b/drivers/scsi/ibmvscsi/Makefile @@ -3,3 +3,4 @@ ibmvfc-objs :=3D ibmvfc-core.o ibmvfc-nvme.o =20 obj-$(CONFIG_SCSI_IBMVSCSI) +=3D ibmvscsi.o obj-$(CONFIG_SCSI_IBMVFC) +=3D ibmvfc.o +obj-$(CONFIG_SCSI_IBMVFC_KUNIT_TEST) +=3D ibmvfc_kunit.o diff --git a/drivers/scsi/ibmvscsi/ibmvfc-core.c b/drivers/scsi/ibmvscsi/ib= mvfc-core.c index 45e030566c06..537d2b565628 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc-core.c +++ b/drivers/scsi/ibmvscsi/ibmvfc-core.c @@ -31,6 +31,9 @@ #include #include #include +#include +#include +#include #include "ibmvfc.h" =20 static unsigned int init_timeout =3D IBMVFC_INIT_TIMEOUT; @@ -3194,6 +3197,7 @@ static const struct ibmvfc_async_desc ae_desc [] =3D { { "Halt", IBMVFC_AE_HALT, IBMVFC_DEFAULT_LOG_LEVEL }, { "Resume", IBMVFC_AE_RESUME, IBMVFC_DEFAULT_LOG_LEVEL }, { "Adapter Failed", IBMVFC_AE_ADAPTER_FAILED, IBMVFC_DEFAULT_LOG_LEVEL }, + { "FPIN", IBMVFC_AE_FPIN, IBMVFC_DEFAULT_LOG_LEVEL }, }; =20 static const struct ibmvfc_async_desc unknown_ae =3D { @@ -3242,16 +3246,249 @@ static const char *ibmvfc_get_link_state(enum ibmv= fc_ae_link_state state) return ""; } =20 +#define IBMVFC_FPIN_CONGN_DESC_SZ (sizeof(struct fc_els_fpin) + sizeof(str= uct fc_fn_congn_desc)) +#define IBMVFC_FPIN_LI_DESC_SZ (sizeof(struct fc_els_fpin) + \ + struct_size_t(struct fc_fn_li_desc, pname_list, 1)) +#define IBMVFC_FPIN_PEER_CONGN_DESC_SZ (sizeof(struct fc_els_fpin) + \ + struct_size_t(struct fc_fn_peer_congn_desc, pname_list, 1)) + +/** + * ibmvfc_fpin_size_helper(): compute fpin structure size based on fpin st= atus + * @fpin_status: status value + * + * Return: + * 0: invalid fpin_status + * other: valid size + */ +static size_t ibmvfc_fpin_size_helper(u8 fpin_status) +{ + size_t size =3D 0; + + switch (fpin_status) { + case IBMVFC_AE_FPIN_LINK_CONGESTED: + case IBMVFC_AE_FPIN_CONGESTION_CLEARED: + size =3D IBMVFC_FPIN_CONGN_DESC_SZ; + break; + case IBMVFC_AE_FPIN_PORT_CONGESTED: + case IBMVFC_AE_FPIN_PORT_CLEARED: + size =3D IBMVFC_FPIN_PEER_CONGN_DESC_SZ; + break; + case IBMVFC_AE_FPIN_PORT_DEGRADED: + size =3D IBMVFC_FPIN_LI_DESC_SZ; + break; + default: + break; + } + + return size; +} + +/** + * ibmvfc_common_fpin_to_desc(): allocate and populate a struct fc_els_fpi= n struct + * containing a descriptor. + * + * 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_common_fpin_to_desc(u8 fpin_status, __be64 wwpn, __be16 type, __be1= 6 modifier, + __be32 threshold, __be32 event_count) +{ + struct fc_fn_peer_congn_desc *pdesc; + struct fc_fn_congn_desc *cdesc; + struct fc_fn_li_desc *ldesc; + struct fc_els_fpin *fpin; + size_t size; + + size =3D ibmvfc_fpin_size_helper(fpin_status); + if (!size) + return NULL; + + fpin =3D kzalloc(size, GFP_KERNEL); + if (!fpin) + return NULL; + + fpin->fpin_cmd =3D ELS_FPIN; + + switch (fpin_status) { + case IBMVFC_AE_FPIN_CONGESTION_CLEARED: + case IBMVFC_AE_FPIN_LINK_CONGESTED: + fpin->desc_len =3D cpu_to_be32(sizeof(struct fc_fn_congn_desc)); + cdesc =3D (struct fc_fn_congn_desc *)fpin->fpin_desc; + cdesc->desc_tag =3D cpu_to_be32(ELS_DTAG_CONGESTION); + cdesc->desc_len =3D cpu_to_be32(FC_TLV_DESC_LENGTH_FROM_SZ(*cdesc)); + cdesc->event_type =3D type; + cdesc->event_modifier =3D modifier; + cdesc->event_period =3D cpu_to_be32(IBMVFC_FPIN_DEFAULT_EVENT_PERIOD); + cdesc->severity =3D FPIN_CONGN_SEVERITY_WARNING; + break; + case IBMVFC_AE_FPIN_PORT_CONGESTED: + case IBMVFC_AE_FPIN_PORT_CLEARED: + fpin->desc_len =3D + cpu_to_be32(struct_size_t(struct fc_fn_peer_congn_desc, pname_list, 1)); + pdesc =3D (struct fc_fn_peer_congn_desc *)fpin->fpin_desc; + pdesc->desc_tag =3D cpu_to_be32(ELS_DTAG_PEER_CONGEST); + pdesc->desc_len =3D cpu_to_be32(struct_size_t(struct fc_fn_peer_congn_de= sc, + pname_list, 1) - FC_TLV_DESC_HDR_SZ); + pdesc->event_type =3D type; + pdesc->event_modifier =3D modifier; + pdesc->event_period =3D cpu_to_be32(IBMVFC_FPIN_DEFAULT_EVENT_PERIOD); + pdesc->attached_wwpn =3D wwpn; + pdesc->pname_count =3D cpu_to_be32(1); + pdesc->pname_list[0] =3D wwpn; + break; + case IBMVFC_AE_FPIN_PORT_DEGRADED: + fpin->desc_len =3D cpu_to_be32(struct_size_t(struct fc_fn_li_desc, pname= _list, 1)); + ldesc =3D (struct fc_fn_li_desc *)fpin->fpin_desc; + ldesc->desc_tag =3D cpu_to_be32(ELS_DTAG_LNK_INTEGRITY); + ldesc->desc_len =3D cpu_to_be32(struct_size_t(struct fc_fn_li_desc, + pname_list, 1) - FC_TLV_DESC_HDR_SZ); + ldesc->event_type =3D type; + ldesc->event_modifier =3D modifier; + ldesc->event_threshold =3D threshold; + ldesc->event_count =3D event_count; + ldesc->attached_wwpn =3D wwpn; + ldesc->pname_count =3D cpu_to_be32(1); + ldesc->pname_list[0] =3D wwpn; + break; + default: + /* This should be caught above. */ + kfree(fpin); + fpin =3D NULL; + break; + } + + return fpin; +} + +/** + * ibmvfc_basic_fpin_to_desc(): allocate and populate a struct fc_els_fpin= struct + * containing a descriptor. + * @ibmvfc_fpin: Pointer to async crq + * + * 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_basic_fpin_to_desc(struct ibmvfc_async_crq *crq, u64 wwpn) +{ + __be16 type; + + switch (crq->fpin_status) { + case IBMVFC_AE_FPIN_LINK_CONGESTED: + case IBMVFC_AE_FPIN_PORT_CONGESTED: + type =3D cpu_to_be16(FPIN_CONGN_DEVICE_SPEC); + break; + case IBMVFC_AE_FPIN_PORT_CLEARED: + case IBMVFC_AE_FPIN_CONGESTION_CLEARED: + type =3D cpu_to_be16(FPIN_CONGN_CLEAR); + break; + case IBMVFC_AE_FPIN_PORT_DEGRADED: + type =3D cpu_to_be16(FPIN_LI_UNKNOWN); + break; + default: + return NULL; + } + + return ibmvfc_common_fpin_to_desc(crq->fpin_status, cpu_to_be64(wwpn), + type, cpu_to_be16(0), + cpu_to_be32(IBMVFC_FPIN_DEFAULT_EVENT_THRESHOLD), + cpu_to_be32(1)); +} + +/** + * ibmvfc_process_async_work - Process IBMVFC_AE_FPIN async CRQ from work = queue + * @work: pointer to work_struct + */ +static void ibmvfc_process_async_work(struct work_struct *work) +{ + struct ibmvfc_async_work *aw; + struct ibmvfc_async_crq *crq; + struct ibmvfc_target *tgt; + struct ibmvfc_host *vhost; + struct fc_els_fpin *fpin; + unsigned long flags; + + aw =3D container_of_const(work, struct ibmvfc_async_work, async_work_s); + vhost =3D aw->vhost; + crq =3D &aw->crq; + + if (!crq->scsi_id && !crq->wwpn && !crq->node_name) + goto free; + + spin_lock_irqsave(vhost->host->host_lock, flags); + list_for_each_entry(tgt, &vhost->scsi_scrqs.targets, queue) { + if (crq->scsi_id && cpu_to_be64(tgt->scsi_id) !=3D crq->scsi_id) + continue; + if (crq->wwpn && cpu_to_be64(tgt->ids.port_name) !=3D crq->wwpn) + continue; + if (crq->node_name && cpu_to_be64(tgt->ids.node_name) !=3D crq->node_nam= e) + continue; + if (!tgt->rport) + continue; + break; + } + + if (!list_entry_is_head(tgt, &vhost->scsi_scrqs.targets, queue) || + !tgt->rport) { + kref_get(&tgt->kref); + spin_unlock_irqrestore(vhost->host->host_lock, flags); + } else { + /* Target not found in scsi_scrqs, search nvme_scrqs */ + list_for_each_entry(tgt, &vhost->nvme_scrqs.targets, queue) { + if (crq->scsi_id && cpu_to_be64(tgt->scsi_id) !=3D crq->scsi_id) + continue; + if (crq->wwpn && cpu_to_be64(tgt->ids.port_name) !=3D crq->wwpn) + continue; + if (crq->node_name && cpu_to_be64(tgt->ids.node_name) !=3D crq->node_na= me) + continue; + if (!tgt->rport) + continue; + break; + } + if (!list_entry_is_head(tgt, &vhost->nvme_scrqs.targets, queue)) { + kref_get(&tgt->kref); + spin_unlock_irqrestore(vhost->host->host_lock, flags); + } else { + spin_unlock_irqrestore(vhost->host->host_lock, flags); + dev_err_ratelimited(vhost->dev, "Invalid target for FPIN\n"); + goto free; + } + } + + fpin =3D ibmvfc_basic_fpin_to_desc(crq, tgt->wwpn); + if (fpin) { + fc_host_fpin_rcv(tgt->vhost->host, + sizeof(*fpin) + be32_to_cpu(fpin->desc_len), + (char *)fpin, 0); + kfree(fpin); + } else + dev_err_ratelimited(vhost->dev, "FPIN event received, unable to process\= n"); + + kref_put(&tgt->kref, ibmvfc_release_tgt); + free: + kfree(aw); +} + /** * ibmvfc_handle_async - Handle an async event from the adapter * @crq: crq to process * @vhost: ibmvfc host struct * **/ -static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq, - struct ibmvfc_host *vhost) +VISIBLE_IF_KUNIT void ibmvfc_handle_async(struct ibmvfc_async_crq *crq, + struct ibmvfc_host *vhost) { const struct ibmvfc_async_desc *desc =3D ibmvfc_get_ae_desc(be64_to_cpu(c= rq->event)); + struct ibmvfc_async_work *aw; struct ibmvfc_target *tgt; =20 ibmvfc_log(vhost, desc->log_level, "%s event received. scsi_id: %llx, wwp= n: %llx," @@ -3326,11 +3563,23 @@ static void ibmvfc_handle_async(struct ibmvfc_async= _crq *crq, case IBMVFC_AE_HALT: ibmvfc_link_down(vhost, IBMVFC_HALTED); break; + case IBMVFC_AE_FPIN: + aw =3D kzalloc(sizeof(struct ibmvfc_async_work), GFP_ATOMIC); + if (aw) { + INIT_WORK(&aw->async_work_s, ibmvfc_process_async_work); + aw->vhost =3D vhost; + aw->crq =3D *crq; + queue_work(vhost->fpin_workq, &aw->async_work_s); + } else + dev_err_ratelimited(vhost->dev, + "can't offload async CRQ to work queue\n"); + break; default: dev_err(vhost->dev, "Unknown async event received: %lld\n", crq->event); break; } } +EXPORT_SYMBOL_IF_KUNIT(ibmvfc_handle_async); =20 /** * ibmvfc_handle_crq - Handles and frees received events in the CRQ @@ -6803,9 +7052,15 @@ static int ibmvfc_probe(struct vio_dev *vdev, const = struct vio_device_id *id) INIT_WORK(&vhost->rport_add_work_q, ibmvfc_rport_add_thread); mutex_init(&vhost->passthru_mutex); =20 - if ((rc =3D ibmvfc_alloc_mem(vhost))) + vhost->fpin_workq =3D devm_alloc_workqueue(vhost->dev, "%s-fpin-workq-%u"= , 0, 0, + IBMVFC_NAME, shost->host_no); + if (vhost->fpin_workq =3D=3D NULL) goto free_scsi_host; =20 + rc =3D ibmvfc_alloc_mem(vhost); + if (rc) + goto free_workq; + vhost->work_thread =3D kthread_run(ibmvfc_work, vhost, "%s_%d", IBMVFC_NA= ME, shost->host_no); =20 @@ -6851,6 +7106,9 @@ static int ibmvfc_probe(struct vio_dev *vdev, const s= truct vio_device_id *id) kthread_stop(vhost->work_thread); free_host_mem: ibmvfc_free_mem(vhost); +free_workq: + destroy_workqueue(vhost->fpin_workq); + vhost->fpin_workq =3D NULL; free_scsi_host: scsi_host_put(shost); out: @@ -7042,5 +7300,11 @@ static void __exit ibmvfc_module_exit(void) fc_release_transport(ibmvfc_transport_template); } =20 +VISIBLE_IF_KUNIT struct list_head *ibmvfc_get_headp(void) +{ + return &ibmvfc_head; +} +EXPORT_SYMBOL_IF_KUNIT(ibmvfc_get_headp); + module_init(ibmvfc_module_init); module_exit(ibmvfc_module_exit); diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h index ca80ceffe53a..e8ca0d30f483 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.h +++ b/drivers/scsi/ibmvscsi/ibmvfc.h @@ -750,8 +750,12 @@ enum ibmvfc_ae_fpin_status { IBMVFC_AE_FPIN_PORT_CONGESTED =3D 0x2, IBMVFC_AE_FPIN_PORT_CLEARED =3D 0x3, IBMVFC_AE_FPIN_PORT_DEGRADED =3D 0x4, + IBMVFC_AE_FPIN_CONGESTION_CLEARED =3D 0x5, }; =20 +#define IBMVFC_FPIN_DEFAULT_EVENT_PERIOD (5*60*MSEC_PER_SEC) /* 5 minutes = */ +#define IBMVFC_FPIN_DEFAULT_EVENT_THRESHOLD (5*60*MSEC_PER_SEC/2) /* 2.5 m= inutes */ + struct ibmvfc_async_crq { volatile u8 valid; u8 link_state; @@ -781,6 +785,12 @@ struct ibmvfc_async_sub_crq { } id; } __packed __aligned(8); =20 +struct ibmvfc_async_work { + struct ibmvfc_host *vhost; + struct ibmvfc_async_crq crq; + struct work_struct async_work_s; +}; + union ibmvfc_iu { struct ibmvfc_mad_common mad_common; struct ibmvfc_npiv_login_mad npiv_login; @@ -1022,6 +1032,7 @@ struct ibmvfc_host { wait_queue_head_t work_wait_q; struct nvme_fc_local_port *nvme_local_port; struct completion nvme_delete_done; + struct workqueue_struct *fpin_workq; }; =20 struct ibmvfc_event *__ibmvfc_get_event(struct ibmvfc_queue *queue, int re= served); @@ -1088,4 +1099,9 @@ static inline struct ibmvfc_host *ibmvfc_channels_to_= vhost(struct ibmvfc_channel #define ibmvfc_remove_trace_file(kobj, attr) do { } while (0) #endif =20 +#ifdef VISIBLE_IF_KUNIT +VISIBLE_IF_KUNIT void ibmvfc_handle_async(struct ibmvfc_async_crq *crq, st= ruct ibmvfc_host *vhost); +VISIBLE_IF_KUNIT struct list_head *ibmvfc_get_headp(void); +#endif + #endif diff --git a/drivers/scsi/ibmvscsi/ibmvfc_kunit.c b/drivers/scsi/ibmvscsi/i= bmvfc_kunit.c new file mode 100644 index 000000000000..64a517a74af8 --- /dev/null +++ b/drivers/scsi/ibmvscsi/ibmvfc_kunit.c @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#include +#include +#include +#include +#include +#include "ibmvfc.h" + +MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING"); + +/** + * ibmvfc_async_fpin_event_test - unit test for IBMVFC_AE_FPIN parts of + * ibmvfc_handle_async + * @test: pointer to kunit structure + * + * Tests + * - error returns from ibmvfc_handle_async + * - statistics updates + * + * Return: void + */ +static void ibmvfc_async_fpin_test(struct kunit *test) +{ + u64 post[IBMVFC_AE_FPIN_CONGESTION_CLEARED + 1]; + u64 pre[IBMVFC_AE_FPIN_CONGESTION_CLEARED + 1]; + enum ibmvfc_ae_fpin_status fs; + struct fc_host_attrs *fc_host; + struct ibmvfc_async_crq crq[IBMVFC_AE_FPIN_CONGESTION_CLEARED + 1]; + struct ibmvfc_target *tgt; + struct ibmvfc_host *vhost; + struct list_head *queue; + struct list_head *headp; + + headp =3D ibmvfc_get_headp(); + if (list_empty(headp)) + kunit_skip(test, "No ibmvfc devices available"); + queue =3D headp->next; + vhost =3D container_of_const(queue, struct ibmvfc_host, queue); + + KUNIT_ASSERT_GE_MSG(test, vhost->scsi_scrqs.num_targets, 1, "No targets"); + tgt =3D list_first_entry(&vhost->scsi_scrqs.targets, struct ibmvfc_target= , queue); + KUNIT_EXPECT_NOT_NULL(test, tgt->rport); + + fc_host =3D shost_to_fc_host(vhost->host); + + pre[IBMVFC_AE_FPIN_LINK_CONGESTED] =3D READ_ONCE(fc_host->fpin_stats.cn_d= evice_specific); + pre[IBMVFC_AE_FPIN_PORT_CONGESTED] =3D READ_ONCE(tgt->rport->fpin_stats.c= n); + pre[IBMVFC_AE_FPIN_PORT_CLEARED] =3D READ_ONCE(tgt->rport->fpin_stats.cn_= clear); + pre[IBMVFC_AE_FPIN_PORT_DEGRADED] =3D READ_ONCE(tgt->rport->fpin_stats.li= _failure_unknown); + pre[IBMVFC_AE_FPIN_CONGESTION_CLEARED] =3D READ_ONCE(fc_host->fpin_stats.= cn_clear); + + for (fs =3D IBMVFC_AE_FPIN_LINK_CONGESTED; fs <=3D IBMVFC_AE_FPIN_CONGEST= ION_CLEARED; fs++) { + crq[fs].valid =3D 0x80; + crq[fs].link_state =3D IBMVFC_AE_LS_LINK_UP; + crq[fs].fpin_status =3D fs; + crq[fs].event =3D cpu_to_be64(IBMVFC_AE_FPIN); + crq[fs].scsi_id =3D cpu_to_be64(tgt->scsi_id); + crq[fs].wwpn =3D cpu_to_be64(tgt->wwpn); + crq[fs].node_name =3D cpu_to_be64(tgt->ids.node_name); + ibmvfc_handle_async(&crq[fs], vhost); + msleep(1U); + } + + post[IBMVFC_AE_FPIN_LINK_CONGESTED] =3D READ_ONCE(fc_host->fpin_stats.cn_= device_specific); + post[IBMVFC_AE_FPIN_PORT_CONGESTED] =3D READ_ONCE(tgt->rport->fpin_stats.= cn); + post[IBMVFC_AE_FPIN_PORT_CLEARED] =3D READ_ONCE(tgt->rport->fpin_stats.cn= _clear); + post[IBMVFC_AE_FPIN_PORT_DEGRADED] =3D READ_ONCE(tgt->rport->fpin_stats.l= i_failure_unknown); + post[IBMVFC_AE_FPIN_CONGESTION_CLEARED] =3D READ_ONCE(fc_host->fpin_stats= .cn_clear); + + KUNIT_EXPECT_GE(test, post[IBMVFC_AE_FPIN_LINK_CONGESTED], + pre[IBMVFC_AE_FPIN_LINK_CONGESTED]+1); + KUNIT_EXPECT_GE(test, post[IBMVFC_AE_FPIN_PORT_CONGESTED], + pre[IBMVFC_AE_FPIN_PORT_CONGESTED]+1); + KUNIT_EXPECT_GE(test, post[IBMVFC_AE_FPIN_PORT_CLEARED], + pre[IBMVFC_AE_FPIN_PORT_CLEARED]+1); + KUNIT_EXPECT_GE(test, post[IBMVFC_AE_FPIN_PORT_DEGRADED], + pre[IBMVFC_AE_FPIN_PORT_DEGRADED]+1); + KUNIT_EXPECT_GE(test, post[IBMVFC_AE_FPIN_CONGESTION_CLEARED], + pre[IBMVFC_AE_FPIN_CONGESTION_CLEARED]+1); + + pre[IBMVFC_AE_FPIN_LINK_CONGESTED] =3D READ_ONCE(fc_host->fpin_stats.cn_d= evice_specific); + pre[IBMVFC_AE_FPIN_PORT_CONGESTED] =3D READ_ONCE(tgt->rport->fpin_stats.c= n); + pre[IBMVFC_AE_FPIN_PORT_CLEARED] =3D READ_ONCE(tgt->rport->fpin_stats.cn_= clear); + pre[IBMVFC_AE_FPIN_PORT_DEGRADED] =3D READ_ONCE(tgt->rport->fpin_stats.li= _failure_unknown); + pre[IBMVFC_AE_FPIN_CONGESTION_CLEARED] =3D READ_ONCE(fc_host->fpin_stats.= cn_clear); + + /* bad path */ + crq[0].valid =3D 0x80; + crq[0].link_state =3D IBMVFC_AE_LS_LINK_UP; + crq[0].fpin_status =3D 0; /* bad value */ + crq[0].event =3D cpu_to_be64(IBMVFC_AE_FPIN); + crq[0].scsi_id =3D cpu_to_be64(tgt->scsi_id); + crq[0].wwpn =3D cpu_to_be64(tgt->wwpn); + crq[0].node_name =3D cpu_to_be64(tgt->ids.node_name); + ibmvfc_handle_async(&crq[0], vhost); + msleep(1U); + + post[IBMVFC_AE_FPIN_LINK_CONGESTED] =3D READ_ONCE(fc_host->fpin_stats.cn_= device_specific); + post[IBMVFC_AE_FPIN_PORT_CONGESTED] =3D READ_ONCE(tgt->rport->fpin_stats.= cn); + post[IBMVFC_AE_FPIN_PORT_CLEARED] =3D READ_ONCE(tgt->rport->fpin_stats.cn= _clear); + post[IBMVFC_AE_FPIN_PORT_DEGRADED] =3D READ_ONCE(tgt->rport->fpin_stats.l= i_failure_unknown); + post[IBMVFC_AE_FPIN_CONGESTION_CLEARED] =3D READ_ONCE(fc_host->fpin_stats= .cn_clear); + + KUNIT_EXPECT_EQ(test, pre[IBMVFC_AE_FPIN_LINK_CONGESTED], + post[IBMVFC_AE_FPIN_LINK_CONGESTED]); + KUNIT_EXPECT_EQ(test, pre[IBMVFC_AE_FPIN_PORT_CONGESTED], + post[IBMVFC_AE_FPIN_PORT_CONGESTED]); + KUNIT_EXPECT_EQ(test, pre[IBMVFC_AE_FPIN_PORT_CLEARED], + post[IBMVFC_AE_FPIN_PORT_CLEARED]); + KUNIT_EXPECT_EQ(test, pre[IBMVFC_AE_FPIN_PORT_DEGRADED], + post[IBMVFC_AE_FPIN_PORT_DEGRADED]); + KUNIT_EXPECT_EQ(test, pre[IBMVFC_AE_FPIN_CONGESTION_CLEARED], + post[IBMVFC_AE_FPIN_CONGESTION_CLEARED]); +} + +static struct kunit_case ibmvfc_fpin_test_cases[] =3D { + KUNIT_CASE_SLOW(ibmvfc_async_fpin_test), + {}, +}; + +static struct kunit_suite ibmvfc_fpin_test_suite =3D { + .name =3D "ibmvfc-fpin-test", + .test_cases =3D ibmvfc_fpin_test_cases, +}; +kunit_test_init_section_suite(ibmvfc_fpin_test_suite); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Dave Marquardt "); +MODULE_DESCRIPTION("Test module for IBM Virtual Fibre Channel Driver"); --=20 2.55.0 From nobody Fri Oct 2 01:10:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13F40387596; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; cv=none; b=taIRq1gMuVmc/pIiBY8AJlSDl/CA6XSHS4IzXKvJyLIVc0U0jcaiQVtw3dkcEk7eNQ1EbEQ9Tb78gPwNqmsV4I2QD+qvXpieVz41Sh/f66rpLJcGDtrKJd5WEXOJ8hYw7hY21p2fL7v7HX6M6jQfVKP5RhnEGlHLrOXEdjv7CpA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; c=relaxed/simple; bh=SS0C1w6R0DRr0Jqzq/W0nd1ACrZ8nFL288TxiJd5ur0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=J4XTwNJQ/uzK4gvMQKe8ZUGIUXKwgGQiusBK4mWHiNxS7OIuHRmxgE0MdKGH1VWKtQiHQDdopL24wJzbiUu0Z7enWemkXFelhA3PtxbDBf+Azwa66qlR9BbCv8Mm+H08OGvbNC5/qVzk82q/8ULcGLF0eMnBpxukyO2hY4FCFWw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NAnySlKn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NAnySlKn" Received: by smtp.kernel.org (Postfix) with ESMTPS id B122CC2BCC7; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1786029460; bh=SS0C1w6R0DRr0Jqzq/W0nd1ACrZ8nFL288TxiJd5ur0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=NAnySlKngq4hMNjGytgL/is8jTiuaCRUjWUq1yPL9g8W0glxDi8VibUY48ABnEAm6 jp+0IeD9vau3UFIgFKXydWzAwfoZijweCpXq0DDvcoRhrr3U1NW+wRUo20ukgHkcSL tXmzd7cJr4P8hw3QovknyRDwsbrcke921uSrGmuc/1H4nRrTncVO+z6C+l1VkXCzCW cCw66k4H0rossCfbVwAtn5ruXUfMlTiXh9QW80fejRA6taFSzG7dOD53THtWzZg1as o7uZ3UH3VlLovBwonBRtQGhUaTEaGVTMT3S2OYT2pRyfzARi9V0HrvbM7hWZTuym+8 fcwsiujiSQUiw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90901C5AC7C; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) From: Dave Marquardt via B4 Relay Date: Thu, 06 Aug 2026 10:17:32 -0500 Subject: [PATCH v5 2/7] scsi: ibmvfc: Add NOOP command support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260806-ibmvfc-fpin-support-v5-2-13fd6f8a8f8b@linux.ibm.com> References: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> In-Reply-To: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> To: "James E.J. Bottomley" , "Martin K. Petersen" , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Tyrel Datwyler Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Brian King , Greg Joyce , Kyle Mahlkuch , Dave Marquardt X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1786029459; l=2480; i=davemarq@linux.ibm.com; s=20260216; h=from:subject:message-id; bh=pi0BYFtkGAwJUETNJURtMT+7ZgQM3DM/lgY7+X9EbdY=; b=07H7YIhit45FZuSgueA4OurntaVC5KR3hltV/ebQVYdxnRalbg7At0j9ECDMI94Qs4fVYKUan vYavy1b1yKGC7ePir+WZF1cJ7cZeiU2h6B+jZZcY+aNjOzFlRFAN+/P X-Developer-Key: i=davemarq@linux.ibm.com; a=ed25519; pk=vy0/nfobrje6EqZxuyw6a3ZstytG8WK2vf5Y3xtGrEg= X-Endpoint-Received: by B4 Relay for davemarq@linux.ibm.com/20260216 with auth_id=689 X-Original-From: Dave Marquardt Reply-To: davemarq@linux.ibm.com From: Dave Marquardt Add support for VFC_NOOP messages from VIOS to enable keep-alive functionality between the client and server. Define the VFC_NOOP CRQ format and add handling in both the main CRQ handler (ibmvfc_handle_crq) and sub-CRQ handler (ibmvfc_handle_scrq). Log unexpected NOOP messages if received before VIOS advertises support during NPIV login. Set the IBMVFC_CAN_USE_NOOP_CMD capability bit during NPIV login to inform VIOS that the client can handle NOOP commands. Signed-off-by: Dave Marquardt --- drivers/scsi/ibmvscsi/ibmvfc-core.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc-core.c b/drivers/scsi/ibmvscsi/ib= mvfc-core.c index 537d2b565628..aec953f29e55 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc-core.c +++ b/drivers/scsi/ibmvscsi/ibmvfc-core.c @@ -1562,7 +1562,9 @@ static void ibmvfc_set_login_info(struct ibmvfc_host = *vhost) login_info->flags |=3D cpu_to_be16(IBMVFC_CLIENT_MIGRATED); =20 login_info->max_cmds =3D cpu_to_be32(max_cmds); - login_info->capabilities =3D cpu_to_be64(IBMVFC_CAN_MIGRATE | IBMVFC_CAN_= SEND_VF_WWPN); + login_info->capabilities =3D + cpu_to_be64(IBMVFC_CAN_MIGRATE | IBMVFC_CAN_SEND_VF_WWPN | + IBMVFC_CAN_USE_NOOP_CMD); =20 if (vhost->mq_enabled || vhost->using_channels) { login_info->capabilities |=3D cpu_to_be64(IBMVFC_CAN_USE_CHANNELS); @@ -3647,6 +3649,14 @@ static void ibmvfc_handle_crq(struct ibmvfc_crq *crq= , struct ibmvfc_host *vhost, if (crq->format =3D=3D IBMVFC_ASYNC_EVENT) return; =20 + if (crq->format =3D=3D IBMVFC_NOOP) { + if (vhost->state =3D=3D IBMVFC_ACTIVE && + !ibmvfc_check_caps(vhost, IBMVFC_SUPPORT_NOOP_CMD)) + dev_err_ratelimited(vhost->dev, + "Received unexpected NOOP command from partner\n"); + return; + } + /* The only kind of payload CRQs we should get are responses to * things we send. Make sure this response is to something we * actually sent @@ -4177,7 +4187,15 @@ static void ibmvfc_handle_scrq(struct ibmvfc_crq *cr= q, struct ibmvfc_host *vhost case IBMVFC_CRQ_XPORT_EVENT: return; default: - dev_err(vhost->dev, "Got and invalid message type 0x%02x\n", crq->valid); + dev_err(vhost->dev, "Got an invalid message type 0x%02x\n", crq->valid); + return; + } + + if (crq->format =3D=3D IBMVFC_NOOP) + return; + + if (unlikely(!evt)) { + dev_err(vhost->dev, "Received null event\n"); return; } =20 --=20 2.55.0 From nobody Fri Oct 2 01:10:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13DB6377015; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; cv=none; b=cj8AuHxfnXKNTkJh+PawQFTkfgUEazrVpXlQlRIhRKcepdJSOSgNwptCX+Ok6XYhhfgQr5QOQKX0c+Q7n0YBGe/Xd9iPBoVK5G1PBpjaCvDVBdaWm4PnkFDL9SoErfkE4haA5HV3us1rnJfm5YQM7q8rZI0BimZSPW6bvNKKBJw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; c=relaxed/simple; bh=NpORjKnGGwSWjo96rY491mQ4DCuXGuJzwqjHxSwNKB0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=avaoelKBJqmX6yob2X7PBntkR/ygqvuY0FFsXEcpMplc1bWRXUEXehj4WQcRUA6lkCBNPK3OHwLZJH4CSLmBa404RX6bnMFXg3FyIsr58Z8uuPuKnICmqoaXczynacUOU+LYH4a00JUPLNFrJ/lF/A5xNk8v9wJXdRTrb4RCQ40= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=STKdnQNm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="STKdnQNm" Received: by smtp.kernel.org (Postfix) with ESMTPS id BD6AAC2BCF7; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1786029460; bh=NpORjKnGGwSWjo96rY491mQ4DCuXGuJzwqjHxSwNKB0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=STKdnQNmPVMeb64FDz98TcSXhTcT5hjpa7BYjytrdcCihGselS5M2B/WukUeCkMRO 3QvdV8jl2FoNZctVu3jxSLAeEL+ysIf287SVxd/oR6oatmNQuVQuO7FUQgW51lHPRp q8VU6IRf6k0qgU06AerKfAH+otcVVb9ALdcFey+teZNgNmK5S8hxzIyPimFSXX4Twe t30SRxyu8ZPJs93WfeYKc8A26smzgPDH5tp2Zp81QeYIPlve2RlSrplTCoE/FY0ryR OGZQKFKZ0n72vsBeusaBzarqE+2dpN/s+7BKxHvj2KBwPzu5nereivkPAMIIWig3JC mOuT48tyBUDRQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3579C56205; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) From: Dave Marquardt via B4 Relay Date: Thu, 06 Aug 2026 10:17:33 -0500 Subject: [PATCH v5 3/7] scsi: ibmvfc: define asynchronous sub-queue Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260806-ibmvfc-fpin-support-v5-3-13fd6f8a8f8b@linux.ibm.com> References: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> In-Reply-To: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> To: "James E.J. Bottomley" , "Martin K. Petersen" , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Tyrel Datwyler Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Brian King , Greg Joyce , Kyle Mahlkuch , Dave Marquardt X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1786029459; l=1853; i=davemarq@linux.ibm.com; s=20260216; h=from:subject:message-id; bh=w68m3zR1aKLFee7eqfMuZfkcraWrl8VL7pHlxbyiDug=; b=EShFeXOjm+MksZFb+wLG8x+m98Oq4fE/ypTeNJ/BB3QEVRM7POCIFoZ+E9bbOccrcGTPt72m6 E6Gce7LJwVsD5NMz1jJ608Nei+4iLjUMakiALFxXZImLIa5DPrId85B X-Developer-Key: i=davemarq@linux.ibm.com; a=ed25519; pk=vy0/nfobrje6EqZxuyw6a3ZstytG8WK2vf5Y3xtGrEg= X-Endpoint-Received: by B4 Relay for davemarq@linux.ibm.com/20260216 with auth_id=689 X-Original-From: Dave Marquardt Reply-To: davemarq@linux.ibm.com From: Dave Marquardt Define data structures for asynchronous sub-queue support required for full and extended FPIN functionality. Add ibmvfc_async_subq structure to represent async events received via the sub-queue, including FPIN status, link state, event type, and WWPN information. Update ibmvfc_channel_setup structure to include async_subq_handle field and reduce IBMVFC_MAX_CHANNELS from 502 to 501 to accommodate the async sub-queue. Add async_scrq pointer to ibmvfc_channels structure. Add capability flags IBMVFC_USE_ASYNC_SUBQ and IBMVFC_SUPPORT_ASYNC_SUBQ for negotiating async sub-queue support with VIOS during login. Signed-off-by: Dave Marquardt --- drivers/scsi/ibmvscsi/ibmvfc.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h index e8ca0d30f483..3711be4b6748 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.h +++ b/drivers/scsi/ibmvscsi/ibmvfc.h @@ -791,6 +791,25 @@ struct ibmvfc_async_work { struct work_struct async_work_s; }; =20 +struct ibmvfc_async_subq { + volatile u8 valid; +#define IBMVFC_ASYNC_ID_IS_ASSOC_ID 0x01 +#define IBMVFC_FC_EEH 0x04 +#define IBMVFC_FC_FW_UPDATE 0x08 +#define IBMVFC_FC_FW_DUMP 0x10 + u8 flags; + u8 link_state; + u8 fpin_status; + __be16 event; + __be16 pad; + volatile __be64 wwpn; + volatile __be64 nport_id; + union { + __be64 node_name; + __be64 assoc_id; + } id; +} __packed __aligned(8); + union ibmvfc_iu { struct ibmvfc_mad_common mad_common; struct ibmvfc_npiv_login_mad npiv_login; @@ -935,6 +954,7 @@ struct ibmvfc_queue { =20 struct ibmvfc_channels { struct ibmvfc_queue *scrqs; + struct ibmvfc_queue *async_scrq; enum ibmvfc_protocol protocol; unsigned int active_queues; unsigned int desired_queues; --=20 2.55.0 From nobody Fri Oct 2 01:10:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13C6C343D63; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; cv=none; b=ggQrB7O8f505yuuVuRius45Wgq6CYA2QCrW0kfc5tGoXY5N1PQiYMdRUD4YuJB6SVf92TfBcge7QvY/pqG/WgDorEHKiOzThVN4mjyGuSRuXMzC8HVhX9X+Tg1f+4xKe7pB/Z/sgW5NwcKzZZ8Fi/m0dcHelFYBM6kpzCVh52kY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; c=relaxed/simple; bh=FsXcpIYOs0w8fAtVAyJEkoHOmC2YdXOKAfol/LybEx4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SY9+QWqyl46QW1Cx5NlasTjgaEzNTKOODQYmPSq22KQISYp4T9bP39P8DJ5VV5Pb33ID4Qug8oJ/8TSTcLZLiBHcblypH4AzO1QPWOBtRL+yXWyoi1X0es+lssbZRkf6SdtUan2FIYX3wY5tLwyRMasxNS4FZPSx9ICi2wnMJYQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=R/V09KsR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="R/V09KsR" Received: by smtp.kernel.org (Postfix) with ESMTPS id CAB74C2BCFD; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1786029460; bh=FsXcpIYOs0w8fAtVAyJEkoHOmC2YdXOKAfol/LybEx4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=R/V09KsR0hIvHyqnuqMxONvRlNEZJ5EBfBf1SzMZc2Ga4CJAuGnHfFma4NQZ9wJTK ZvHMCZATA2AfO50gJOug80ShzqQ/ab3ekNo4tI7Mte+hXdG5AuR6/Y8K1M2Y4QhGwQ C29sN3uUXT1T/n73gnF7jXbumAK/ocsucqDU7aw/vPJGUac75Q6lbMl0D195okGd1h LKIzgLl6W3/UsvgNXE2CedGNsoWlNLa597JK9reoMdCZ0yLJeU3UPO2c2jJeyiFvRq 40Q49Smskvv6M4LgPfHKRyXOcBpiMm3lSOL6YvaXbg9vGRnw98weJA2684VLofWOte j+YS+DX2OzcuA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B64D0C5AC80; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) From: Dave Marquardt via B4 Relay Date: Thu, 06 Aug 2026 10:17:34 -0500 Subject: [PATCH v5 4/7] scsi: ibmvfc: allocate asynchronous sub-queue Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260806-ibmvfc-fpin-support-v5-4-13fd6f8a8f8b@linux.ibm.com> References: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> In-Reply-To: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> To: "James E.J. Bottomley" , "Martin K. Petersen" , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Tyrel Datwyler Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Brian King , Greg Joyce , Kyle Mahlkuch , Dave Marquardt X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1786029459; l=2503; i=davemarq@linux.ibm.com; s=20260216; h=from:subject:message-id; bh=5RuNy3ewl5Y+dwhrMNnUroVom0cpBS0889/aQRw9BCM=; b=O2TVx4DtdVUFoCtw1cVhQdxnL8xx6AGWr6s5zDZUbvq19acN6cJSzKuNbQzSLuTtAcwdDLCSQ ncLWojrmHDUBgFyMBkBTwTcp6dFmxIAiJQAtDQF0f+mn74t6mkEqtMk X-Developer-Key: i=davemarq@linux.ibm.com; a=ed25519; pk=vy0/nfobrje6EqZxuyw6a3ZstytG8WK2vf5Y3xtGrEg= X-Endpoint-Received: by B4 Relay for davemarq@linux.ibm.com/20260216 with auth_id=689 X-Original-From: Dave Marquardt Reply-To: davemarq@linux.ibm.com From: Dave Marquardt Allocate and initialize the asynchronous sub-queue required for receiving full and extended FPIN events from VIOS. Modify ibmvfc_alloc_channels() to allocate async_scrq using ibmvfc_alloc_queue() with IBMVFC_SUB_CRQ_FMT format. Update error handling to properly clean up async_scrq on allocation failures. Update ibmvfc_channel_setup() to pass async_subq_handle to VIOS during channel setup, and ibmvfc_channel_setup_done() to store the VIOS cookie for the async sub-queue. Modify ibmvfc_release_channels() to free async_scrq resources during cleanup. Signed-off-by: Dave Marquardt --- drivers/scsi/ibmvscsi/ibmvfc-core.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc-core.c b/drivers/scsi/ibmvscsi/ib= mvfc-core.c index aec953f29e55..06898a407d07 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc-core.c +++ b/drivers/scsi/ibmvscsi/ibmvfc-core.c @@ -6726,6 +6726,17 @@ static int ibmvfc_alloc_channels(struct ibmvfc_host = *vhost, if (!channels->scrqs) return -ENOMEM; =20 + channels->async_scrq =3D kzalloc_obj(*channels->async_scrq, GFP_KERNEL); + if (!channels->async_scrq) { + rc =3D -ENOMEM; + goto free_scrqs; + } + + rc =3D ibmvfc_alloc_queue(vhost, channels->async_scrq, + IBMVFC_SUB_CRQ_FMT); + if (rc) + goto free_async; + for (i =3D 0; i < channels->max_queues; i++) { scrq =3D &channels->scrqs[i]; rc =3D ibmvfc_alloc_queue(vhost, scrq, IBMVFC_SUB_CRQ_FMT); @@ -6734,13 +6745,21 @@ static int ibmvfc_alloc_channels(struct ibmvfc_host= *vhost, scrq =3D &channels->scrqs[j - 1]; ibmvfc_free_queue(vhost, scrq); } - kfree(channels->scrqs); - channels->scrqs =3D NULL; + ibmvfc_free_queue(vhost, channels->async_scrq); channels->active_queues =3D 0; - return rc; + goto free_async; } } =20 + return rc; + +free_async: + kfree(channels->async_scrq); + channels->async_scrq =3D NULL; +free_scrqs: + kfree(channels->scrqs); + channels->scrqs =3D NULL; + return rc; } =20 @@ -6782,8 +6801,15 @@ static void ibmvfc_release_channels(struct ibmvfc_ho= st *vhost, =20 kfree(channels->scrqs); channels->scrqs =3D NULL; + channels->active_queues =3D 0; } + + if (channels->async_scrq) { + ibmvfc_free_queue(vhost, channels->async_scrq); + kfree(channels->async_scrq); + channels->async_scrq =3D NULL; + } } =20 static void ibmvfc_release_sub_crqs(struct ibmvfc_host *vhost) --=20 2.55.0 From nobody Fri Oct 2 01:10:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 475003DB300; Thu, 6 Aug 2026 15:17:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; cv=none; b=LVYu2HTUuYS+pt0SYzhoi0ajA/accwLhi4lTUNizMr3LMawdmFMBK9RVBSCpS6oyDvk3vCDu8KmKcBhboQDmigBp27iBvoa+MvWOyyWFIbV1XntpuwXJ6ACLV2RRJ/pvVClTU/Xj7+OC9zzxPV/8blIpjHh0Ne26022biq6aD3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; c=relaxed/simple; bh=OTxN7kQjitD3U/oCraK3tzXxvi90nhziNZVRBl+f4lY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ja3MuAS5R2Z0LmmRxIHMgY2Ke7ApNu3e2mp0UcnH6x5LDIBEqmYDM65knV6jN6clRfn9Dwg3Lu3scV5XryRyWIVpvX5izBOwdauOuYGp6iQhdgNmZ3WsaicPkgzQFNw7mvgmfU0ZG7GdV+IPkSG/lvUZ+I3vYAER7O5FOlkxxsY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oltzWP3Q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oltzWP3Q" Received: by smtp.kernel.org (Postfix) with ESMTPS id DD48AC2BCFB; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1786029460; bh=OTxN7kQjitD3U/oCraK3tzXxvi90nhziNZVRBl+f4lY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=oltzWP3QijqA2Khz6zmuczKnB0KsrbqlsY4lh8hP0rCAjmBOuRJOdnyB/ZFMmpQGR z994kexCHyNUVXUugYmB0yMYT0MmfBEHubK/BRs9V7K7Nnab+5ET/J4Q1EeCWr+fGU wU+MXULD710/Qx0C+WtCzo7NWxFAViSVpT3EUSn+YM4qSlXOLHKcMBhR+9CReC1v5E rGEkx6ootF1XG+SmiS8wzoepDc4mYEJb8oaRWUXHgdkhp2B7OXtRujIloyOousBoqO mELkuDbMIP/J8P2KQZ8CRW3/l51CjxTb0r9kc3eBcxUhZ4wMJEueW4RFp4BbQiuzVh cuolP4PLQELug== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9F31C5AC7E; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) From: Dave Marquardt via B4 Relay Date: Thu, 06 Aug 2026 10:17:35 -0500 Subject: [PATCH v5 5/7] scsi: ibmvfc: extend async event handlers to handle async sub queue events Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260806-ibmvfc-fpin-support-v5-5-13fd6f8a8f8b@linux.ibm.com> References: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> In-Reply-To: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> To: "James E.J. Bottomley" , "Martin K. Petersen" , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Tyrel Datwyler Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Brian King , Greg Joyce , Kyle Mahlkuch , Dave Marquardt X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1786029459; l=13895; i=davemarq@linux.ibm.com; s=20260216; h=from:subject:message-id; bh=k1+095EGq7VZWAHVlNP6StVTuZjc2jmI+D0cZtE1Fhk=; b=EeCe6UrKAKjqSG2FinpluE4mDvYNS8JHdCsR2tZ+0FOmNaGlf0pX1IvovU1GviU+4kkED77h6 Wg2/Ex5123dAKQlPnFwPwCsToYRWuPzQe9NLmEOCOyaumQer2II6iA0 X-Developer-Key: i=davemarq@linux.ibm.com; a=ed25519; pk=vy0/nfobrje6EqZxuyw6a3ZstytG8WK2vf5Y3xtGrEg= X-Endpoint-Received: by B4 Relay for davemarq@linux.ibm.com/20260216 with auth_id=689 X-Original-From: Dave Marquardt Reply-To: davemarq@linux.ibm.com From: Dave Marquardt Refactor async event handling to support both traditional async CRQs and new asynchronous sub-queue CRQs. Modify ibmvfc_handle_async() to accept events from either source and update ibmvfc_process_async_work() to handle both ibmvfc_async_crq and ibmvfc_async_subq structures. Add is_subq flag to ibmvfc_async_work to distinguish between event sources. Add ibmvfc_full_fpin_to_desc() to convert full FPIN messages from async sub-queue format to fc_els_fpin structures. Update FPIN processing logic to extract WWPN, node_name, and scsi_id from the appropriate structure based on event source. Update KUnit tests to reflect the new async event handling interface. Signed-off-by: Dave Marquardt --- drivers/scsi/ibmvscsi/ibmvfc-core.c | 204 +++++++++++++++++++++++++------= ---- drivers/scsi/ibmvscsi/ibmvfc.h | 17 +-- drivers/scsi/ibmvscsi/ibmvfc_kunit.c | 6 +- 3 files changed, 158 insertions(+), 69 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc-core.c b/drivers/scsi/ibmvscsi/ib= mvfc-core.c index 06898a407d07..230bf2be6531 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc-core.c +++ b/drivers/scsi/ibmvscsi/ibmvfc-core.c @@ -3406,67 +3406,115 @@ ibmvfc_basic_fpin_to_desc(struct ibmvfc_async_crq = *crq, u64 wwpn) cpu_to_be32(1)); } =20 +/** + * 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_subq *ibmvfc_fpin) +{ + return ibmvfc_common_fpin_to_desc(ibmvfc_fpin->fpin_status, ibmvfc_fpin->= wwpn, + cpu_to_be16(0), cpu_to_be16(0), + cpu_to_be32(IBMVFC_FPIN_DEFAULT_EVENT_THRESHOLD), + cpu_to_be32(1)); +} + +/** + * ibmvfc_find_target - Search for a target in a target list + * @target_list: list head of targets to search + * @scsi_id: SCSI ID to match (0 to skip this check) + * @wwpn: WWPN to match (0 to skip this check) + * @node_name: Node name to match (0 to skip this check) + * + * Returns: + * Pointer to matching target, or NULL if not found + **/ +static struct ibmvfc_target *ibmvfc_find_target(struct list_head *target_l= ist, + __be64 scsi_id, __be64 wwpn, + __be64 node_name) +{ + struct ibmvfc_target *tgt; + + list_for_each_entry(tgt, target_list, queue) { + if (scsi_id && cpu_to_be64(tgt->scsi_id) !=3D scsi_id) + continue; + if (wwpn && cpu_to_be64(tgt->ids.port_name) !=3D wwpn) + continue; + if (node_name && cpu_to_be64(tgt->ids.node_name) !=3D node_name) + continue; + if (!tgt->rport) + continue; + return tgt; + } + + return NULL; +} + /** * ibmvfc_process_async_work - Process IBMVFC_AE_FPIN async CRQ from work = queue * @work: pointer to work_struct */ static void ibmvfc_process_async_work(struct work_struct *work) { + struct ibmvfc_async_subq *subq =3D NULL; struct ibmvfc_async_work *aw; - struct ibmvfc_async_crq *crq; + struct ibmvfc_async_crq *crq =3D NULL; struct ibmvfc_target *tgt; struct ibmvfc_host *vhost; - struct fc_els_fpin *fpin; + struct fc_els_fpin *fpin =3D NULL; unsigned long flags; + __be64 node_name; + __be64 scsi_id; + bool is_subq; + __be64 wwpn; =20 aw =3D container_of_const(work, struct ibmvfc_async_work, async_work_s); vhost =3D aw->vhost; - crq =3D &aw->crq; + is_subq =3D aw->is_subq; + if (is_subq) { + subq =3D &aw->crq.subq; + scsi_id =3D 0; + wwpn =3D subq->wwpn; + node_name =3D subq->id.node_name; + } else { + crq =3D &aw->crq.async_crq; + scsi_id =3D crq->scsi_id; + wwpn =3D crq->wwpn; + node_name =3D crq->node_name; + } =20 - if (!crq->scsi_id && !crq->wwpn && !crq->node_name) + if (!scsi_id && !wwpn && !node_name) goto free; =20 spin_lock_irqsave(vhost->host->host_lock, flags); - list_for_each_entry(tgt, &vhost->scsi_scrqs.targets, queue) { - if (crq->scsi_id && cpu_to_be64(tgt->scsi_id) !=3D crq->scsi_id) - continue; - if (crq->wwpn && cpu_to_be64(tgt->ids.port_name) !=3D crq->wwpn) - continue; - if (crq->node_name && cpu_to_be64(tgt->ids.node_name) !=3D crq->node_nam= e) - continue; - if (!tgt->rport) - continue; - break; + tgt =3D ibmvfc_find_target(&vhost->scsi_scrqs.targets, scsi_id, wwpn, nod= e_name); + if (!tgt) { + /* Target not found in scsi_scrqs, search nvme_scrqs */ + tgt =3D ibmvfc_find_target(&vhost->nvme_scrqs.targets, scsi_id, wwpn, no= de_name); } =20 - if (!list_entry_is_head(tgt, &vhost->scsi_scrqs.targets, queue) || - !tgt->rport) { + if (tgt) { kref_get(&tgt->kref); spin_unlock_irqrestore(vhost->host->host_lock, flags); } else { - /* Target not found in scsi_scrqs, search nvme_scrqs */ - list_for_each_entry(tgt, &vhost->nvme_scrqs.targets, queue) { - if (crq->scsi_id && cpu_to_be64(tgt->scsi_id) !=3D crq->scsi_id) - continue; - if (crq->wwpn && cpu_to_be64(tgt->ids.port_name) !=3D crq->wwpn) - continue; - if (crq->node_name && cpu_to_be64(tgt->ids.node_name) !=3D crq->node_na= me) - continue; - if (!tgt->rport) - continue; - break; - } - if (!list_entry_is_head(tgt, &vhost->nvme_scrqs.targets, queue)) { - kref_get(&tgt->kref); - spin_unlock_irqrestore(vhost->host->host_lock, flags); - } else { - spin_unlock_irqrestore(vhost->host->host_lock, flags); - dev_err_ratelimited(vhost->dev, "Invalid target for FPIN\n"); - goto free; - } + spin_unlock_irqrestore(vhost->host->host_lock, flags); + dev_err_ratelimited(vhost->dev, "Invalid target for FPIN\n"); + goto free; } =20 - fpin =3D ibmvfc_basic_fpin_to_desc(crq, tgt->wwpn); + if (crq) + fpin =3D ibmvfc_basic_fpin_to_desc(crq, tgt->wwpn); + else + fpin =3D ibmvfc_full_fpin_to_desc(subq); + if (fpin) { fc_host_fpin_rcv(tgt->vhost->host, sizeof(*fpin) + be32_to_cpu(fpin->desc_len), @@ -3482,25 +3530,52 @@ static void ibmvfc_process_async_work(struct work_s= truct *work) =20 /** * ibmvfc_handle_async - Handle an async event from the adapter - * @crq: crq to process + * @crq: ibmvfc_async_crq or ibmvfc_async_subq * @vhost: ibmvfc host struct + * @is_subq: indicates whether the crq points to a struct ibmvfc_async_subq * **/ -VISIBLE_IF_KUNIT void ibmvfc_handle_async(struct ibmvfc_async_crq *crq, - struct ibmvfc_host *vhost) +VISIBLE_IF_KUNIT void ibmvfc_handle_async(void *crq, + struct ibmvfc_host *vhost, + bool is_subq) { - const struct ibmvfc_async_desc *desc =3D ibmvfc_get_ae_desc(be64_to_cpu(c= rq->event)); + struct ibmvfc_async_crq *async_crq =3D NULL; + struct ibmvfc_async_subq *subq =3D NULL; + const struct ibmvfc_async_desc *desc; struct ibmvfc_async_work *aw; struct ibmvfc_target *tgt; - - ibmvfc_log(vhost, desc->log_level, "%s event received. scsi_id: %llx, wwp= n: %llx," - " node_name: %llx%s\n", desc->desc, be64_to_cpu(crq->scsi_id), - be64_to_cpu(crq->wwpn), be64_to_cpu(crq->node_name), - ibmvfc_get_link_state(crq->link_state)); - - switch (be64_to_cpu(crq->event)) { + __be64 node_name; + __be64 scsi_id; + u8 link_state; + __be64 wwpn; + u64 event; + + if (is_subq) { + subq =3D crq; + event =3D be16_to_cpu(subq->event); + link_state =3D subq->link_state; + scsi_id =3D 0; + wwpn =3D subq->wwpn; + node_name =3D subq->id.node_name; + } else { + async_crq =3D crq; + event =3D be64_to_cpu(async_crq->event); + link_state =3D async_crq->link_state; + scsi_id =3D async_crq->scsi_id; + wwpn =3D async_crq->wwpn; + node_name =3D async_crq->node_name; + } + + desc =3D ibmvfc_get_ae_desc(event); + ibmvfc_log(vhost, desc->log_level, + "%s event received. scsi_id: %llx, wwpn: %llx, node_name: %llx, event= %llx%s\n", + desc->desc, be64_to_cpu(scsi_id), + be64_to_cpu(wwpn), be64_to_cpu(node_name), event, + ibmvfc_get_link_state(link_state)); + + switch (event) { case IBMVFC_AE_RESUME: - switch (crq->link_state) { + switch (link_state) { case IBMVFC_AE_LS_LINK_DOWN: ibmvfc_link_down(vhost, IBMVFC_LINK_DOWN); break; @@ -3539,17 +3614,17 @@ VISIBLE_IF_KUNIT void ibmvfc_handle_async(struct ib= mvfc_async_crq *crq, case IBMVFC_AE_ELS_PRLO: case IBMVFC_AE_ELS_PLOGI: list_for_each_entry(tgt, &vhost->scsi_scrqs.targets, queue) { - if (!crq->scsi_id && !crq->wwpn && !crq->node_name) + if (!scsi_id && !wwpn && !node_name) break; - if (crq->scsi_id && cpu_to_be64(tgt->scsi_id) !=3D crq->scsi_id) + if (scsi_id && cpu_to_be64(tgt->scsi_id) !=3D scsi_id) continue; - if (crq->wwpn && cpu_to_be64(tgt->ids.port_name) !=3D crq->wwpn) + if (wwpn && cpu_to_be64(tgt->ids.port_name) !=3D wwpn) continue; - if (crq->node_name && cpu_to_be64(tgt->ids.node_name) !=3D crq->node_na= me) + if (node_name && cpu_to_be64(tgt->ids.node_name) !=3D node_name) continue; - if (tgt->need_login && be64_to_cpu(crq->event) =3D=3D IBMVFC_AE_ELS_LOG= O) + if (tgt->need_login && event =3D=3D IBMVFC_AE_ELS_LOGO) tgt->logo_rcvd =3D 1; - if (!tgt->need_login || be64_to_cpu(crq->event) =3D=3D IBMVFC_AE_ELS_PL= OGI) { + if (!tgt->need_login || event =3D=3D IBMVFC_AE_ELS_PLOGI) { ibmvfc_del_tgt(tgt); ibmvfc_reinit_host(vhost); } @@ -3570,16 +3645,27 @@ VISIBLE_IF_KUNIT void ibmvfc_handle_async(struct ib= mvfc_async_crq *crq, if (aw) { INIT_WORK(&aw->async_work_s, ibmvfc_process_async_work); aw->vhost =3D vhost; - aw->crq =3D *crq; + aw->is_subq =3D is_subq; + if (is_subq) + aw->crq.subq =3D *subq; + else + aw->crq.async_crq =3D *async_crq; queue_work(vhost->fpin_workq, &aw->async_work_s); } else dev_err_ratelimited(vhost->dev, "can't offload async CRQ to work queue\n"); break; default: - dev_err(vhost->dev, "Unknown async event received: %lld\n", crq->event); + dev_err(vhost->dev, "Unknown async event received: %llu\n", event); break; } + + rmb(); + if (is_subq) + subq->valid =3D 0; + else + async_crq->valid =3D 0; + wmb(); } EXPORT_SYMBOL_IF_KUNIT(ibmvfc_handle_async); =20 @@ -4118,7 +4204,7 @@ static void ibmvfc_tasklet(void *data) while (!done) { /* Pull all the valid messages off the async CRQ */ while ((async =3D ibmvfc_next_async_crq(vhost)) !=3D NULL) { - ibmvfc_handle_async(async, vhost); + ibmvfc_handle_async(async, vhost, false); async->valid =3D 0; wmb(); } @@ -4133,7 +4219,7 @@ static void ibmvfc_tasklet(void *data) vio_enable_interrupts(vdev); if ((async =3D ibmvfc_next_async_crq(vhost)) !=3D NULL) { vio_disable_interrupts(vdev); - ibmvfc_handle_async(async, vhost); + ibmvfc_handle_async(async, vhost, false); async->valid =3D 0; wmb(); } else if ((crq =3D ibmvfc_next_crq(vhost)) !=3D NULL) { diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h index 3711be4b6748..89c1ef462d52 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.h +++ b/drivers/scsi/ibmvscsi/ibmvfc.h @@ -785,12 +785,6 @@ struct ibmvfc_async_sub_crq { } id; } __packed __aligned(8); =20 -struct ibmvfc_async_work { - struct ibmvfc_host *vhost; - struct ibmvfc_async_crq crq; - struct work_struct async_work_s; -}; - struct ibmvfc_async_subq { volatile u8 valid; #define IBMVFC_ASYNC_ID_IS_ASSOC_ID 0x01 @@ -810,6 +804,15 @@ struct ibmvfc_async_subq { } id; } __packed __aligned(8); =20 +struct ibmvfc_async_work { + struct ibmvfc_host *vhost; + bool is_subq; + union { + struct ibmvfc_async_crq async_crq; + struct ibmvfc_async_subq subq; + } crq; + struct work_struct async_work_s; +}; union ibmvfc_iu { struct ibmvfc_mad_common mad_common; struct ibmvfc_npiv_login_mad npiv_login; @@ -1120,7 +1123,7 @@ static inline struct ibmvfc_host *ibmvfc_channels_to_= vhost(struct ibmvfc_channel #endif =20 #ifdef VISIBLE_IF_KUNIT -VISIBLE_IF_KUNIT void ibmvfc_handle_async(struct ibmvfc_async_crq *crq, st= ruct ibmvfc_host *vhost); +VISIBLE_IF_KUNIT void ibmvfc_handle_async(void *crq, struct ibmvfc_host *v= host, bool is_subq); VISIBLE_IF_KUNIT struct list_head *ibmvfc_get_headp(void); #endif =20 diff --git a/drivers/scsi/ibmvscsi/ibmvfc_kunit.c b/drivers/scsi/ibmvscsi/i= bmvfc_kunit.c index 64a517a74af8..a3e3e3471c5e 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc_kunit.c +++ b/drivers/scsi/ibmvscsi/ibmvfc_kunit.c @@ -45,7 +45,7 @@ static void ibmvfc_async_fpin_test(struct kunit *test) fc_host =3D shost_to_fc_host(vhost->host); =20 pre[IBMVFC_AE_FPIN_LINK_CONGESTED] =3D READ_ONCE(fc_host->fpin_stats.cn_d= evice_specific); - pre[IBMVFC_AE_FPIN_PORT_CONGESTED] =3D READ_ONCE(tgt->rport->fpin_stats.c= n); + pre[IBMVFC_AE_FPIN_PORT_CONGESTED] =3D READ_ONCE(tgt->rport->fpin_stats.c= n_device_specific); pre[IBMVFC_AE_FPIN_PORT_CLEARED] =3D READ_ONCE(tgt->rport->fpin_stats.cn_= clear); pre[IBMVFC_AE_FPIN_PORT_DEGRADED] =3D READ_ONCE(tgt->rport->fpin_stats.li= _failure_unknown); pre[IBMVFC_AE_FPIN_CONGESTION_CLEARED] =3D READ_ONCE(fc_host->fpin_stats.= cn_clear); @@ -58,7 +58,7 @@ static void ibmvfc_async_fpin_test(struct kunit *test) crq[fs].scsi_id =3D cpu_to_be64(tgt->scsi_id); crq[fs].wwpn =3D cpu_to_be64(tgt->wwpn); crq[fs].node_name =3D cpu_to_be64(tgt->ids.node_name); - ibmvfc_handle_async(&crq[fs], vhost); + ibmvfc_handle_async(&crq[fs], vhost, false); msleep(1U); } =20 @@ -93,7 +93,7 @@ static void ibmvfc_async_fpin_test(struct kunit *test) crq[0].scsi_id =3D cpu_to_be64(tgt->scsi_id); crq[0].wwpn =3D cpu_to_be64(tgt->wwpn); crq[0].node_name =3D cpu_to_be64(tgt->ids.node_name); - ibmvfc_handle_async(&crq[0], vhost); + ibmvfc_handle_async(&crq[0], vhost, false); msleep(1U); =20 post[IBMVFC_AE_FPIN_LINK_CONGESTED] =3D READ_ONCE(fc_host->fpin_stats.cn_= device_specific); --=20 2.55.0 From nobody Fri Oct 2 01:10:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 476413E1205; Thu, 6 Aug 2026 15:17:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; cv=none; b=FBPnpemHzYLKyxbvNipIDOgytKyVHAAB0I7SGtmBRN7weeR0YfnWpOno+lvY4ocHIFkAgLgkBXbCqYhsIcwAH404QwPEiMvkxdO2zLj8XjX0GpO2aZkzKzmc8WRJ2KL9CF9pez547pdpD9KVDu54oNC2muLAtlgNI+kvZ/yuSZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; c=relaxed/simple; bh=GCpp8loI/qph9CLzy+fFISXczkAT4Cpt7iOweu2NwRs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fNRI1MkAcn/RSDaCqW3LZ2+0jM7i1aZM+hZmY2jme6mRORBXwZ+YN5ws5EC7t0YUpaV2Z3C0XyfLh0MhD4Bh9WelejYL4bMtV9gAuZAqL+5FP9ifKFHV1DqlZas5FdsFcRb3zHCfo3irdOx5KZOZQ5IwQrg7N3NAEkSlyXAIsJQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=owik93Tl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="owik93Tl" Received: by smtp.kernel.org (Postfix) with ESMTPS id F09F7C2BCFF; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1786029461; bh=GCpp8loI/qph9CLzy+fFISXczkAT4Cpt7iOweu2NwRs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=owik93Tl/AuuoOAu7IwY03tiIwMmvPPnxNCflN5phhQb/fqdOordsRorZlF3hydna FsyMGw12BV5iQb5p6bp/AUH68jc51pMGDMI01yjaLUX0RN4kQdVfOy9qv9KUyGXQW7 Z9FkfJ6g/2raZjg0eeP2gQakVvN8EGFqv4m6AEaXPX1EPXsSzajGyJT89VOy5M4IIC afDD5rBhMRVxm08akknqnD+InLrAE1NxTBr7zqK/kOpf4AhAqOlx6iAN2RBMXjJtfv U3nL1i6d9BELzvnOZztuB7WkBrnPR6XSobwJ8W3UqLfR0AumtrwmoasQ6QsCja7GoJ hAPyauke1uVUA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC760C56207; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) From: Dave Marquardt via B4 Relay Date: Thu, 06 Aug 2026 10:17:36 -0500 Subject: [PATCH v5 6/7] scsi: ibmvfc: register and use asynchronous sub-queue for events Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260806-ibmvfc-fpin-support-v5-6-13fd6f8a8f8b@linux.ibm.com> References: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> In-Reply-To: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> To: "James E.J. Bottomley" , "Martin K. Petersen" , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Tyrel Datwyler Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Brian King , Greg Joyce , Kyle Mahlkuch , Dave Marquardt X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1786029459; l=8719; i=davemarq@linux.ibm.com; s=20260216; h=from:subject:message-id; bh=fCuKuW0pL10CRvqISUmrayWRJcBYtnsRj+Nrw2rw9WU=; b=k94URTV124LThEM0RS/RNjfDe4FWM2nzMWsLX2DIvpeoYWrfmVQfHL8xo9oDdODdqLcv3cSME +HSlYdxXjkeDNP0K0XKjSRwKWJsdnHPCGBnHzLDhtzulZkz793mDc4e X-Developer-Key: i=davemarq@linux.ibm.com; a=ed25519; pk=vy0/nfobrje6EqZxuyw6a3ZstytG8WK2vf5Y3xtGrEg= X-Endpoint-Received: by B4 Relay for davemarq@linux.ibm.com/20260216 with auth_id=689 X-Original-From: Dave Marquardt Reply-To: davemarq@linux.ibm.com From: Dave Marquardt Complete async sub-queue integration by setting up interrupt handling, registering the queue as a channel, and enabling its use during NPIV login. Add ibmvfc_interrupt_async_subq() interrupt handler and ibmvfc_drain_async_subq() to process events from the async sub-queue. Refactor ibmvfc_register_channel() into ibmvfc_register_channel_common() to support both regular sub-CRQs and the async sub-queue with different interrupt handlers. Update ibmvfc_set_login_info() to set IBMVFC_CAN_USE_CHANNELS, IBMVFC_YES_SCSI, IBMVFC_USE_ASYNC_SUBQ, and IBMVFC_CAN_HANDLE_FPIN capability bits when channels are enabled, informing VIOS that the client supports async sub-queue and FPIN handling. Register async_scrq during channel initialization and unregister during cleanup. --- drivers/scsi/ibmvscsi/ibmvfc-core.c | 146 ++++++++++++++++++++++++++++++--= ---- 1 file changed, 124 insertions(+), 22 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc-core.c b/drivers/scsi/ibmvscsi/ib= mvfc-core.c index 230bf2be6531..c002226f4617 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc-core.c +++ b/drivers/scsi/ibmvscsi/ibmvfc-core.c @@ -1568,9 +1568,11 @@ static void ibmvfc_set_login_info(struct ibmvfc_host= *vhost) =20 if (vhost->mq_enabled || vhost->using_channels) { login_info->capabilities |=3D cpu_to_be64(IBMVFC_CAN_USE_CHANNELS); + login_info->capabilities |=3D cpu_to_be64(IBMVFC_USE_ASYNC_SUBQ); + login_info->capabilities |=3D cpu_to_be64(IBMVFC_CAN_HANDLE_FPIN); + login_info->capabilities |=3D cpu_to_be64(IBMVFC_YES_SCSI); if (vhost->nvme_enabled) { login_info->capabilities |=3D cpu_to_be64(IBMVFC_YES_NVMEOF); - login_info->capabilities |=3D cpu_to_be64(IBMVFC_YES_SCSI); login_info->capabilities |=3D cpu_to_be64(IBMVFC_CAN_USE_WWPN_ALL); } } @@ -4321,6 +4323,52 @@ static struct ibmvfc_crq *ibmvfc_next_scrq(struct ib= mvfc_queue *scrq) return crq; } =20 +static void ibmvfc_drain_async_subq(struct ibmvfc_queue *scrq) +{ + struct ibmvfc_host *vhost =3D scrq->vhost; + struct ibmvfc_crq *crq; + unsigned long flags; + int done =3D 0; + + spin_lock_irqsave(vhost->host->host_lock, flags); + spin_lock(scrq->q_lock); + while (!done) { + while ((crq =3D ibmvfc_next_scrq(scrq)) !=3D NULL) { + ibmvfc_handle_async(crq, scrq->vhost, true); + crq->valid =3D 0; + wmb(); /* complete write */ + } + + ibmvfc_toggle_scrq_irq(scrq, 1); + crq =3D ibmvfc_next_scrq(scrq); + if (crq !=3D NULL) { + ibmvfc_toggle_scrq_irq(scrq, 0); + ibmvfc_handle_async(crq, scrq->vhost, true); + crq->valid =3D 0; + wmb(); /* complete write */ + } else + done =3D 1; + } + spin_unlock(scrq->q_lock); + spin_unlock_irqrestore(vhost->host->host_lock, flags); +} + +/** + * ibmvfc_interrupt_asyncq - Handle an async event from the adapter + * @irq: interrupt request + * @scrq_instance: async subq + * + **/ +static irqreturn_t ibmvfc_interrupt_async_subq(int irq, void *scrq_instanc= e) +{ + struct ibmvfc_queue *scrq =3D (struct ibmvfc_queue *)scrq_instance; + + ibmvfc_toggle_scrq_irq(scrq, 0); + ibmvfc_drain_async_subq(scrq); + + return IRQ_HANDLED; +} + static void ibmvfc_drain_sub_crq(struct ibmvfc_queue *scrq) { struct ibmvfc_crq *crq; @@ -6666,14 +6714,29 @@ static int ibmvfc_init_crq(struct ibmvfc_host *vhos= t) return retrc; } =20 -static int ibmvfc_register_channel(struct ibmvfc_host *vhost, - struct ibmvfc_channels *channels, - int index) +/** + * ibmvfc_register_channel_common - Register a sub-CRQ with the hypervisor + * @vhost: ibmvfc host struct + * @channels: ibmvfc channels struct + * @scrq: sub-CRQ to register + * @index: channel index (negative for async) + * @irq: interrupt handler for the sub-CRQ + * + * Return value: + * 0 on success / non-zero on failure + **/ +static int ibmvfc_register_channel_common(struct ibmvfc_host *vhost, + struct ibmvfc_channels *channels, + struct ibmvfc_queue *scrq, + int index, + irq_handler_t irq) { struct device *dev =3D vhost->dev; struct vio_dev *vdev =3D to_vio_dev(dev); - struct ibmvfc_queue *scrq =3D &channels->scrqs[index]; + long hcall_rc; int rc =3D -ENOMEM; + const char *name_suffix; + bool is_async =3D (index < 0); =20 ENTER; =20 @@ -6692,20 +6755,19 @@ static int ibmvfc_register_channel(struct ibmvfc_ho= st *vhost, =20 if (!scrq->irq) { rc =3D -EINVAL; - dev_err(dev, "Error mapping sub-crq[%d] irq\n", index); + if (is_async) + dev_err(dev, "Error mapping sub-crq[%s] irq\n", "async"); + else + dev_err(dev, "Error mapping sub-crq[%d] irq\n", index); goto irq_failed; } =20 switch (channels->protocol) { case IBMVFC_PROTO_SCSI: - snprintf(scrq->name, sizeof(scrq->name), "ibmvfc-%x-scsi%d", - vdev->unit_address, index); - scrq->handler =3D ibmvfc_interrupt_mq; + name_suffix =3D "scsi"; break; case IBMVFC_PROTO_NVME: - snprintf(scrq->name, sizeof(scrq->name), "ibmvfc-%x-nvmf%d", - vdev->unit_address, index); - scrq->handler =3D ibmvfc_interrupt_mq; + name_suffix =3D "nvmf"; break; default: dev_err(dev, "Unknown channel protocol (%d)\n", @@ -6713,35 +6775,63 @@ static int ibmvfc_register_channel(struct ibmvfc_ho= st *vhost, goto irq_failed; } =20 + if (is_async) { + snprintf(scrq->name, sizeof(scrq->name), "ibmvfc-%x-%s%s", + vdev->unit_address, name_suffix, "async"); + scrq->handler =3D irq; + } else { + snprintf(scrq->name, sizeof(scrq->name), "ibmvfc-%x-%s%d", + vdev->unit_address, name_suffix, index); + scrq->handler =3D irq ? irq : ibmvfc_interrupt_mq; + scrq->hwq_id =3D index; + } + rc =3D request_irq(scrq->irq, scrq->handler, 0, scrq->name, scrq); =20 if (rc) { - dev_err(dev, "Couldn't register sub-crq[%d] irq\n", index); + if (is_async) + dev_err(dev, "Couldn't register sub-crq[%s] irq\n", "async"); + else + dev_err(dev, "Couldn't register sub-crq[%d] irq\n", index); irq_dispose_mapping(scrq->irq); goto irq_failed; } =20 - scrq->hwq_id =3D index; - LEAVE; return 0; =20 irq_failed: do { - rc =3D plpar_hcall_norets(H_FREE_SUB_CRQ, vdev->unit_address, scrq->cook= ie); - } while (rc =3D=3D H_BUSY || H_IS_LONG_BUSY(rc)); + hcall_rc =3D plpar_hcall_norets(H_FREE_SUB_CRQ, vdev->unit_address, scrq= ->cookie); + } while (hcall_rc =3D=3D H_BUSY || H_IS_LONG_BUSY(hcall_rc)); reg_failed: LEAVE; return rc; } =20 +static int ibmvfc_register_channel_async(struct ibmvfc_host *vhost, + struct ibmvfc_channels *channels, + struct ibmvfc_queue *scrq, + irq_handler_t irq) +{ + return ibmvfc_register_channel_common(vhost, channels, scrq, -1, irq); +} + +static int ibmvfc_register_channel(struct ibmvfc_host *vhost, + struct ibmvfc_channels *channels, + int index) +{ + struct ibmvfc_queue *scrq =3D &channels->scrqs[index]; + + return ibmvfc_register_channel_common(vhost, channels, scrq, index, NULL); +} + static void ibmvfc_deregister_channel(struct ibmvfc_host *vhost, struct ibmvfc_channels *channels, - int index) + struct ibmvfc_queue *scrq) { struct device *dev =3D vhost->dev; struct vio_dev *vdev =3D to_vio_dev(dev); - struct ibmvfc_queue *scrq =3D &channels->scrqs[index]; long rc; =20 ENTER; @@ -6756,7 +6846,7 @@ static void ibmvfc_deregister_channel(struct ibmvfc_h= ost *vhost, } while (rc =3D=3D H_BUSY || H_IS_LONG_BUSY(rc)); =20 if (rc) - dev_err(dev, "Failed to free sub-crq[%d]: rc=3D%ld\n", index, rc); + dev_err(dev, "Failed to free sub-crq[%s]: rc=3D%ld\n", scrq->name, rc); =20 /* Clean out the queue */ memset(scrq->msgs.crq, 0, PAGE_SIZE); @@ -6774,10 +6864,21 @@ static void ibmvfc_reg_sub_crqs(struct ibmvfc_host = *vhost, if (!vhost->mq_enabled || !channels->scrqs) return; =20 + if (ibmvfc_register_channel_async(vhost, channels, + channels->async_scrq, + ibmvfc_interrupt_async_subq)) { + vhost->do_enquiry =3D 0; + return; + } + for (i =3D 0; i < channels->max_queues; i++) { if (ibmvfc_register_channel(vhost, channels, i)) { for (j =3D i; j > 0; j--) - ibmvfc_deregister_channel(vhost, channels, j - 1); + ibmvfc_deregister_channel( + vhost, channels, &channels->scrqs[j - 1]); + ibmvfc_deregister_channel(vhost, channels, + channels->async_scrq); + vhost->do_enquiry =3D 0; return; } @@ -6796,7 +6897,8 @@ static void ibmvfc_dereg_sub_crqs(struct ibmvfc_host = *vhost, return; =20 for (i =3D 0; i < channels->max_queues; i++) - ibmvfc_deregister_channel(vhost, channels, i); + ibmvfc_deregister_channel(vhost, channels, &channels->scrqs[i]); + ibmvfc_deregister_channel(vhost, channels, channels->async_scrq); =20 LEAVE; } --=20 2.55.0 From nobody Fri Oct 2 01:10:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 525BA3EEAC2; Thu, 6 Aug 2026 15:17:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; cv=none; b=WlegHlKQkq/sg6xfU5x9jPlUUJjpTKbHi1pWiw/R7pyfFtSzh7/x9H1AP/s8GmrZ7k/iVXesKCV9ZANlMq8OJaEkw+raHFKyjnaqczhuwWfUZCHtOUx09hULOu8I2JkViyJZVopEruh+/jUKS5cxNHZvoH04Bnh+3rDvc5wT2oI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786029461; c=relaxed/simple; bh=IlIlxX8LNBNEbhyGWjD9uMsPWtlk/p3Q+GcLOW31zyE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NgwYHz+CnBbSNM+0VhnriUpPOz4GGOpiytuaDFKAk5yQfTJkyZota3sKnyqnxDV9hDtBf2b3OwLkum/Dlxmh9AF/1UUb4rhlXQE97vRXUMVyQQr0OdGDAYJUhvfpgrS6FrDWQP9OxpE8kiXqqRXphaCrXJE98yIWWyZX+dZ95fg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ga0O7iQs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ga0O7iQs" Received: by smtp.kernel.org (Postfix) with ESMTPS id 12169C2BCFC; Thu, 6 Aug 2026 15:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1786029461; bh=IlIlxX8LNBNEbhyGWjD9uMsPWtlk/p3Q+GcLOW31zyE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Ga0O7iQsRhddiR+tl8jZKhBhA49Q7znorHL8CCwg0mRLxY+mDU4092/MZkWQnPR6z Z/HreFU+tfjlnHG45so/43GcHPR4QZF/uUB/NL32VfccSpuL59H+DY8ma5C/2GxVJN WbyLafq6lNbSaOALZtyViJUDp3U3+6X3kmFdijAHU2J7xBloeiO9bPHqndR6q/JCWJ GXYB8L4k8fzPl9M4mfDyW4XruTIco+1KWFHLw2TcSvHzdXqzeQZByGqB8wNWiIOQKW qtAaO4s8vD/Lg/MhF/O5C+YZFLXwXSb8ZiVPuqAwr7ltFzDDCprxx9lbjrunhE3/ke jdVkjVPIY/jdg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEAE8C56205; Thu, 6 Aug 2026 15:17:40 +0000 (UTC) From: Dave Marquardt via B4 Relay Date: Thu, 06 Aug 2026 10:17:37 -0500 Subject: [PATCH v5 7/7] scsi: ibmvfc: handle extended FPIN events Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260806-ibmvfc-fpin-support-v5-7-13fd6f8a8f8b@linux.ibm.com> References: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> In-Reply-To: <20260806-ibmvfc-fpin-support-v5-0-13fd6f8a8f8b@linux.ibm.com> To: "James E.J. Bottomley" , "Martin K. Petersen" , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Tyrel Datwyler Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Brian King , Greg Joyce , Kyle Mahlkuch , Dave Marquardt X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1786029459; l=11527; i=davemarq@linux.ibm.com; s=20260216; h=from:subject:message-id; bh=6LwWu4C1d9sMf+as2F628kOIhmeMeqM+MTnXh6D5c3E=; b=KP4f8kQBxk9t/+XsJSlyW61lFHABwiLs9ddRxxUxZbk2BH5KqP/Pc0pHp83eRPhvhYkskkWSk qIRXyHrZWs9CVklqwYcWiu9HR7viesHk93n2IgXkUF4gLp+gtmP+9jl X-Developer-Key: i=davemarq@linux.ibm.com; a=ed25519; pk=vy0/nfobrje6EqZxuyw6a3ZstytG8WK2vf5Y3xtGrEg= X-Endpoint-Received: by B4 Relay for davemarq@linux.ibm.com/20260216 with auth_id=689 X-Original-From: Dave Marquardt Reply-To: davemarq@linux.ibm.com From: Dave Marquardt Implement support for extended FPIN messages received via the asynchronous sub-queue, completing full FPIN functionality. Extended FPIN messages provide more detailed information about fabric events compared to basic FPIN messages, including specific event types, modifiers, thresholds, and event counts. Add ibmvfc_extended_fpin_to_desc() to convert extended FPIN messages from async sub-queue format to fc_els_fpin structures with complete descriptor information. Update ibmvfc_process_async_work() to handle extended FPIN events from the async sub-queue. Set IBMVFC_CAN_HANDLE_FPIN capability during login to inform VIOS that the client can process extended FPIN messages. Add comprehensive KUnit tests to validate extended FPIN event handling and verify proper statistics updates for all FPIN event types. Signed-off-by: Dave Marquardt --- drivers/scsi/ibmvscsi/ibmvfc-core.c | 53 ++++++++++++++++- drivers/scsi/ibmvscsi/ibmvfc.h | 31 ++++++++++ drivers/scsi/ibmvscsi/ibmvfc_kunit.c | 112 +++++++++++++++++++++++++++++++= +++- 3 files changed, 193 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc-core.c b/drivers/scsi/ibmvscsi/ib= mvfc-core.c index c002226f4617..96948be28a5c 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc-core.c +++ b/drivers/scsi/ibmvscsi/ibmvfc-core.c @@ -1571,6 +1571,7 @@ static void ibmvfc_set_login_info(struct ibmvfc_host = *vhost) login_info->capabilities |=3D cpu_to_be64(IBMVFC_USE_ASYNC_SUBQ); login_info->capabilities |=3D cpu_to_be64(IBMVFC_CAN_HANDLE_FPIN); login_info->capabilities |=3D cpu_to_be64(IBMVFC_YES_SCSI); + login_info->capabilities |=3D cpu_to_be64(IBMVFC_CAN_HANDLE_FPIN_EXT); if (vhost->nvme_enabled) { login_info->capabilities |=3D cpu_to_be64(IBMVFC_YES_NVMEOF); login_info->capabilities |=3D cpu_to_be64(IBMVFC_CAN_USE_WWPN_ALL); @@ -3429,6 +3430,41 @@ ibmvfc_full_fpin_to_desc(struct ibmvfc_async_subq *i= bmvfc_fpin) cpu_to_be32(1)); } =20 +/** + * ibmvfc_ext_fpin_to_desc(): allocate and populate a struct fc_els_fpin s= truct + * 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) +{ + u8 flags =3D ibmvfc_fpin->fpin_data.flags; + __be32 threshold =3D cpu_to_be32(IBMVFC_FPIN_DEFAULT_EVENT_THRESHOLD); + __be16 modifier =3D 0; + __be32 count =3D cpu_to_be32(1); + __be16 type =3D 0; + + if (flags & IBMVFC_FPIN_EVENT_TYPE_VALID) + type =3D ibmvfc_fpin->fpin_data.event_type; + if (flags & IBMVFC_FPIN_MODIFIER_VALID) + modifier =3D ibmvfc_fpin->fpin_data.event_type_modifier; + if (flags & IBMVFC_FPIN_THRESHOLD_VALID) + threshold =3D ibmvfc_fpin->fpin_data.event_threshold; + if (flags & IBMVFC_FPIN_EVENT_COUNT_VALID) + count =3D ibmvfc_fpin->fpin_data.event_data.event_count; + + return ibmvfc_common_fpin_to_desc(ibmvfc_fpin->fpin_status, + ibmvfc_fpin->wwpn, type, + modifier, threshold, count); +} + /** * ibmvfc_find_target - Search for a target in a target list * @target_list: list head of targets to search @@ -3466,6 +3502,7 @@ static struct ibmvfc_target *ibmvfc_find_target(struc= t list_head *target_list, */ static void ibmvfc_process_async_work(struct work_struct *work) { + struct ibmvfc_async_subq_fpin *sqfpin; struct ibmvfc_async_subq *subq =3D NULL; struct ibmvfc_async_work *aw; struct ibmvfc_async_crq *crq =3D NULL; @@ -3514,8 +3551,20 @@ static void ibmvfc_process_async_work(struct work_st= ruct *work) =20 if (crq) fpin =3D ibmvfc_basic_fpin_to_desc(crq, tgt->wwpn); - else - fpin =3D ibmvfc_full_fpin_to_desc(subq); + else { + sqfpin =3D (struct ibmvfc_async_subq_fpin *)subq; + if ((subq->flags & IBMVFC_ASYNC_IS_FPIN_EXT) =3D=3D 0) { + fpin =3D ibmvfc_full_fpin_to_desc(subq); + } else if (!(sqfpin->fpin_data.flags & IBMVFC_FPIN_EVENT_TYPE_VALID)) { + dev_err_ratelimited(vhost->dev, + "Invalid extended FPIN event received\n"); + } else if (!ibmvfc_check_caps(vhost, IBMVFC_SUPPORT_FPIN_EXT)) { + dev_err_ratelimited(vhost->dev, + "Unexpected extended FPIN event received\n"); + } else { + fpin =3D ibmvfc_ext_fpin_to_desc(sqfpin); + } + } =20 if (fpin) { fc_host_fpin_rcv(tgt->vhost->host, diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h index 89c1ef462d52..8e37ab439538 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.h +++ b/drivers/scsi/ibmvscsi/ibmvfc.h @@ -210,6 +210,7 @@ struct ibmvfc_npiv_login { #define IBMVFC_CAN_USE_WWPN_ALL 0x080 #define IBMVFC_USE_ASYNC_SUBQ 0x100 #define IBMVFC_CAN_USE_NOOP_CMD 0x200 +#define IBMVFC_CAN_HANDLE_FPIN_EXT 0x800 __be64 node_name; struct srp_direct_buf async; u8 partition_name[IBMVFC_MAX_NAME]; @@ -261,6 +262,7 @@ struct ibmvfc_npiv_login_resp { #define IBMVFC_SUPPORT_WWPN_ALL 0x0400 #define IBMVFC_ASYNC_SUBQ 0x0800 #define IBMVFC_SUPPORT_NOOP_CMD 0x1000 +#define IBMVFC_SUPPORT_FPIN_EXT 0x2000 __be32 max_cmds; __be32 scsi_id_sz; __be64 max_dma_len; @@ -788,6 +790,7 @@ struct ibmvfc_async_sub_crq { struct ibmvfc_async_subq { volatile u8 valid; #define IBMVFC_ASYNC_ID_IS_ASSOC_ID 0x01 +#define IBMVFC_ASYNC_IS_FPIN_EXT 0x02 #define IBMVFC_FC_EEH 0x04 #define IBMVFC_FC_FW_UPDATE 0x08 #define IBMVFC_FC_FW_DUMP 0x10 @@ -804,6 +807,34 @@ struct ibmvfc_async_subq { } id; } __packed __aligned(8); =20 +struct ibmvfc_fpin_data { +#define IBMVFC_FPIN_EVENT_TYPE_VALID 0x01 +#define IBMVFC_FPIN_MODIFIER_VALID 0x02 +#define IBMVFC_FPIN_THRESHOLD_VALID 0x04 +#define IBMVFC_FPIN_SEVERITY_VALID 0x08 +#define IBMVFC_FPIN_EVENT_COUNT_VALID 0x10 + u8 flags; + u8 reserved[3]; + __be16 event_type; + __be16 event_type_modifier; + __be32 event_threshold; + union { + u8 severity; + __be32 event_count; + } event_data; +} __packed __aligned(8); + +struct ibmvfc_async_subq_fpin { + volatile u8 valid; + u8 flags; + u8 link_state; + u8 fpin_status; + __be16 event; + __be16 pad; + volatile __be64 wwpn; + struct ibmvfc_fpin_data fpin_data; +} __packed __aligned(8); + struct ibmvfc_async_work { struct ibmvfc_host *vhost; bool is_subq; diff --git a/drivers/scsi/ibmvscsi/ibmvfc_kunit.c b/drivers/scsi/ibmvscsi/i= bmvfc_kunit.c index a3e3e3471c5e..8c9ba748597b 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc_kunit.c +++ b/drivers/scsi/ibmvscsi/ibmvfc_kunit.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include "ibmvfc.h" @@ -114,8 +115,117 @@ static void ibmvfc_async_fpin_test(struct kunit *test) post[IBMVFC_AE_FPIN_CONGESTION_CLEARED]); } =20 +#define IBMVFC_TEST_FPIN_EXT(fs, ev, stat, crq) { \ + crq.valid =3D 0x80; \ + crq.flags =3D IBMVFC_ASYNC_IS_FPIN_EXT; \ + crq.link_state =3D IBMVFC_AE_LS_LINK_UP; \ + crq.fpin_status =3D (fs); \ + crq.event =3D cpu_to_be16(IBMVFC_AE_FPIN); \ + crq.wwpn =3D cpu_to_be64(tgt->wwpn); \ + crq.fpin_data.flags =3D IBMVFC_FPIN_EVENT_TYPE_VALID; \ + crq.fpin_data.event_type =3D cpu_to_be16((ev)); \ + pre =3D READ_ONCE(tgt->rport->fpin_stats.stat); \ + ibmvfc_handle_async((struct ibmvfc_crq *)&crq, vhost, true); \ + msleep(1U); \ + post =3D READ_ONCE(tgt->rport->fpin_stats.stat); \ +} + +/** + * ibmvfc_extended_fpin_test - unit test for extended FPIN events + * @test: pointer to kunit structure + * + * Tests + * + * Return: void + */ +static void ibmvfc_extended_fpin_test(struct kunit *test) +{ + enum ibmvfc_ae_fpin_status fs; + struct ibmvfc_async_subq_fpin crq[IBMVFC_AE_FPIN_CONGESTION_CLEARED+1] = =3D {}; + struct ibmvfc_async_subq_fpin + crqcn[IBMVFC_AE_FPIN_PORT_CONGESTED][FPIN_CONGN_DEVICE_SPEC+1] =3D {}; + struct ibmvfc_async_subq_fpin crqportdg[FPIN_LI_DEVICE_SPEC+1] =3D {}; + struct ibmvfc_target *tgt; + struct ibmvfc_host *vhost; + struct list_head *headp; + LIST_HEAD(evt_doneq); + u64 pre, post; + + headp =3D ibmvfc_get_headp(); + KUNIT_ASSERT_FALSE_MSG(test, list_empty(headp), "No ibmvfc devices availa= ble\n"); + vhost =3D list_first_entry(headp, struct ibmvfc_host, queue); + KUNIT_ASSERT_GE_MSG(test, vhost->scsi_scrqs.num_targets, 1, "No targets"); + + tgt =3D list_first_entry(&vhost->scsi_scrqs.targets, struct ibmvfc_target= , queue); + KUNIT_ASSERT_NOT_NULL(test, tgt->rport); + + for (fs =3D IBMVFC_AE_FPIN_LINK_CONGESTED; fs <=3D IBMVFC_AE_FPIN_CONGEST= ION_CLEARED; fs++) { + switch (fs) { + case IBMVFC_AE_FPIN_PORT_CLEARED: + case IBMVFC_AE_FPIN_CONGESTION_CLEARED: + crq[fs].valid =3D 0x80; + crq[fs].flags =3D IBMVFC_ASYNC_IS_FPIN_EXT; + crq[fs].link_state =3D IBMVFC_AE_LS_LINK_UP; + crq[fs].fpin_status =3D fs; + crq[fs].event =3D cpu_to_be16(IBMVFC_AE_FPIN); + crq[fs].wwpn =3D cpu_to_be64(tgt->wwpn); + crq[fs].fpin_data.flags =3D IBMVFC_FPIN_EVENT_TYPE_VALID; + crq[fs].fpin_data.event_type =3D cpu_to_be16(FPIN_CONGN_CLEAR); + pre =3D READ_ONCE(tgt->rport->fpin_stats.cn_clear); + ibmvfc_handle_async((struct ibmvfc_crq *)&crq[fs], vhost, true); + msleep(1U); + post =3D READ_ONCE(tgt->rport->fpin_stats.cn_clear); + break; + case IBMVFC_AE_FPIN_LINK_CONGESTED: + case IBMVFC_AE_FPIN_PORT_CONGESTED: + IBMVFC_TEST_FPIN_EXT(fs, FPIN_CONGN_CLEAR, cn_clear, + crqcn[fs-1][FPIN_CONGN_CLEAR]); + IBMVFC_TEST_FPIN_EXT(fs, FPIN_CONGN_LOST_CREDIT, + cn_lost_credit, + crqcn[fs-1][FPIN_CONGN_LOST_CREDIT]); + IBMVFC_TEST_FPIN_EXT(fs, FPIN_CONGN_CREDIT_STALL, + cn_credit_stall, + crqcn[fs-1][FPIN_CONGN_CREDIT_STALL]); + IBMVFC_TEST_FPIN_EXT(fs, FPIN_CONGN_OVERSUBSCRIPTION, + cn_oversubscription, + crqcn[fs-1][FPIN_CONGN_OVERSUBSCRIPTION]); + IBMVFC_TEST_FPIN_EXT(fs, FPIN_CONGN_DEVICE_SPEC, + cn_device_specific, + crqcn[fs-1][FPIN_CONGN_DEVICE_SPEC]); + break; + case IBMVFC_AE_FPIN_PORT_DEGRADED: + IBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_UNKNOWN, + li_failure_unknown, + crqportdg[FPIN_LI_UNKNOWN]); + IBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_LINK_FAILURE, + li_link_failure_count, + crqportdg[FPIN_LI_LINK_FAILURE]); + IBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_LOSS_OF_SYNC, + li_loss_of_sync_count, + crqportdg[FPIN_LI_LOSS_OF_SYNC]); + IBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_LOSS_OF_SIG, + li_loss_of_signals_count, + crqportdg[FPIN_LI_LOSS_OF_SIG]); + IBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_PRIM_SEQ_ERR, + li_prim_seq_err_count, + crqportdg[FPIN_LI_PRIM_SEQ_ERR]); + IBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_INVALID_TX_WD, + li_invalid_tx_word_count, + crqportdg[FPIN_LI_INVALID_TX_WD]); + IBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_INVALID_CRC, + li_invalid_crc_count, + crqportdg[FPIN_LI_INVALID_CRC]); + IBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_DEVICE_SPEC, + li_device_specific, + crqportdg[FPIN_LI_DEVICE_SPEC]); + break; + } + } +} + static struct kunit_case ibmvfc_fpin_test_cases[] =3D { - KUNIT_CASE_SLOW(ibmvfc_async_fpin_test), + KUNIT_CASE(ibmvfc_async_fpin_test), + KUNIT_CASE(ibmvfc_extended_fpin_test), {}, }; =20 --=20 2.55.0