get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2221017/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2221017,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2221017/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260408-ibmvfc-fpin-support-v1-5-52b06c464e03@linux.ibm.com/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/"
    },
    "msgid": "<20260408-ibmvfc-fpin-support-v1-5-52b06c464e03@linux.ibm.com>",
    "date": "2026-04-08T17:07:46",
    "name": "[5/5] ibmvfc: handle extended FPIN events",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "e3e248097a3bc5c61105d4384d8943a7cf1cd217",
    "submitter": {
        "id": 93089,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/93089/?format=api",
        "name": "Dave Marquardt via B4 Relay",
        "email": "devnull+davemarq.linux.ibm.com@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260408-ibmvfc-fpin-support-v1-5-52b06c464e03@linux.ibm.com/mbox/",
    "series": [
        {
            "id": 499164,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/499164/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=499164",
            "date": "2026-04-08T17:07:44",
            "name": "ibmvfc: make ibmvfc support FPIN messages",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499164/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2221017/comments/",
    "check": "fail",
    "checks": "http://patchwork.ozlabs.org/api/patches/2221017/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linuxppc-dev+bounces-19517-incoming=patchwork.ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=Ocbg/lsb;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-19517-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2600:3c0a:e001:78e:0:1991:8:25\"",
            "lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org",
            "lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=Ocbg/lsb;\n\tdkim-atps=neutral",
            "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org\n (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org;\n envelope-from=devnull+davemarq.linux.ibm.com@kernel.org;\n receiver=lists.ozlabs.org)"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frTz64rpMz1xv0\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 03:08:02 +1000 (AEST)",
            "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4frTz00rcrz2ynv;\n\tThu, 09 Apr 2026 03:07:56 +1000 (AEST)",
            "from sea.source.kernel.org (sea.source.kernel.org\n [IPv6:2600:3c0a:e001:78e:0:1991:8:25])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4frTyw3n0Lz2ySV\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 09 Apr 2026 03:07:52 +1000 (AEST)",
            "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby sea.source.kernel.org (Postfix) with ESMTP id BC34A4444D;\n\tWed,  8 Apr 2026 17:07:49 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPS id A08D0C2BCB1;\n\tWed,  8 Apr 2026 17:07:49 +0000 (UTC)",
            "from aws-us-west-2-korg-lkml-1.web.codeaurora.org\n (localhost.localdomain [127.0.0.1])\n\tby smtp.lore.kernel.org (Postfix) with ESMTP id 99A2110F995A;\n\tWed,  8 Apr 2026 17:07:49 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1775668075;\n\tcv=none;\n b=XRpihwr4ySV0SSHPwRhDmzvJP7s2U9Jf2uPLxEtivwiQ6zYWJsGfwowoKK16sp9xxmXJBmlSNrXQMHkrXllDfnuJPKHzpciPsCABciVq6+YtC80yMy9EiVPSF/L/k99oJC7nYcUt/rQveh9C1AZS5T+hui/mkF6DlpXs+FvCgkP7th1o0SalQt76sqpbr5EmFS1PlmJ8RqJhhizRIA8VFiyOZ5Lmy9ak05M/CSATxT7nni2sByiEPpBULCl5PZtkrO3T7XPJGO7fxNPP+JzHGMsWWuUdP4R7iQY7vhpR7vmqjpSQMJSVuYyLllsdS6g8Mg7cLCG7COsAwzBDCLohyQ==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1775668075; c=relaxed/relaxed;\n\tbh=EEjnRTD2OIaSfWdx2iY5pkgRavqm6AlgILxXrGf8RV8=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=XnBtxOy+PLve3gNsLTmA3fdxbVF5D5ABgjs7QsiQmiOIdWr5GqD5wL75rSTotnWnafrgxS5rP8C97TqP3xTMA4j4edTSq5t5xRpz9dA+ZhRYAlwY2MdD7I2OhiHozHqE/8HjvksUwi0Eju7ekB4EkBp1DBWIBJ154PyhFnP8pRoRDphGu8L8jcjzeMSDpOeFgylJDLsSy2l12cRc8SJHxJkW6O0Tp5GSWZqSTTLiQ49QTTEW6SrI1CSg2+rQ+oE1fl6Hzq4TgXpZYjC9BiaIccNSlLTIN9cbWnlNmUpPfOm0vlYwW2z4aC9kZlT3r8prnbViEC+KLMSZEom82yi5yg==",
        "ARC-Authentication-Results": "i=1; lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=Ocbg/lsb; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25;\n helo=sea.source.kernel.org;\n envelope-from=devnull+davemarq.linux.ibm.com@kernel.org;\n receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1775668069;\n\tbh=zwA56Yqiwr2hYr09aUVbK39ayJWrZtzg/aI4jH771Ww=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From;\n\tb=Ocbg/lsb5pL8lEc6+IODBY+fBXaT8VowhSZhMsq7JQYp9ezg1ezWkpH0LiObOB9Q/\n\t hKBuebOkRz0uBAm4YUgVC3eucXqjZ/ZEZ8riACu/HH3oTcj6Z95KXWpIpWA92ePAQ/\n\t 7zE4naZBl594Uz7Cnl/A08/w/Re9yV1yZ1xoWpraATUQfF3n512/WIfKXlIAGzN0nH\n\t NaPbgGYZnKOXytd8Ercw2ybLCWPcOMW36TCYoU67qFTKW4SJzI8ZcW8H19lC3+S6GW\n\t CSVFrSH8/2yIsq4zKh3kF4Vel1xMYeO9l5SvG7QrMvdEWVDRCEtqoW93i/e5SxXS65\n\t u2xPbD9zgIhXA==",
        "From": "Dave Marquardt via B4 Relay <devnull+davemarq.linux.ibm.com@kernel.org>",
        "Date": "Wed, 08 Apr 2026 12:07:46 -0500",
        "Subject": "[PATCH 5/5] ibmvfc: handle extended FPIN events",
        "X-Mailing-List": "linuxppc-dev@lists.ozlabs.org",
        "List-Id": "<linuxppc-dev.lists.ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev+help@lists.ozlabs.org>",
        "List-Owner": "<mailto:linuxppc-dev+owner@lists.ozlabs.org>",
        "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>",
        "List-Archive": "<https://lore.kernel.org/linuxppc-dev/>,\n  <https://lists.ozlabs.org/pipermail/linuxppc-dev/>",
        "List-Subscribe": "<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>",
        "List-Unsubscribe": "<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>",
        "Precedence": "list",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "<20260408-ibmvfc-fpin-support-v1-5-52b06c464e03@linux.ibm.com>",
        "References": "<20260408-ibmvfc-fpin-support-v1-0-52b06c464e03@linux.ibm.com>",
        "In-Reply-To": "<20260408-ibmvfc-fpin-support-v1-0-52b06c464e03@linux.ibm.com>",
        "To": "\"James E.J. Bottomley\" <James.Bottomley@HansenPartnership.com>,\n \"Martin K. Petersen\" <martin.petersen@oracle.com>,\n Madhavan Srinivasan <maddy@linux.ibm.com>,\n Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,\n \"Christophe Leroy (CS GROUP)\" <chleroy@kernel.org>,\n Tyrel Datwyler <tyreld@linux.ibm.com>",
        "Cc": "linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,\n linuxppc-dev@lists.ozlabs.org, Brian King <brking@linux.ibm.com>,\n Greg Joyce <gjoyce@linux.ibm.com>, Kyle Mahlkuch <kmahlkuc@linux.ibm.com>,\n Dave Marquardt <davemarq@linux.ibm.com>",
        "X-Mailer": "b4 0.15.1",
        "X-Developer-Signature": "v=1; a=ed25519-sha256; t=1775668068; l=10995;\n i=davemarq@linux.ibm.com; s=20260216; h=from:subject:message-id;\n bh=vv+F3DfvZ3t42iXcKfwqdduLxzp5NLekpCHcp3Rrl2s=;\n b=X2Rj9wDyoDu72CHShscZC93E0/laRK3YKzZ0f3Eu4B/aD1Q/UvvZ8K9i2pGsjqUk+jNRkqIYz\n D7jH9G96kI6AUcJgfXkj0ucdFT4eFSkeW9F7TKpru41Qnw98npGytYm",
        "X-Developer-Key": "i=davemarq@linux.ibm.com; a=ed25519;\n pk=vy0/nfobrje6EqZxuyw6a3ZstytG8WK2vf5Y3xtGrEg=",
        "X-Endpoint-Received": "by B4 Relay for davemarq@linux.ibm.com/20260216 with\n auth_id=689",
        "X-Original-From": "Dave Marquardt <davemarq@linux.ibm.com>",
        "Reply-To": "davemarq@linux.ibm.com",
        "X-Spam-Status": "No, score=-0.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,\n\tDKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS\n\tautolearn=disabled version=4.0.1 OzLabs 8",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org"
    },
    "content": "From: Dave Marquardt <davemarq@linux.ibm.com>\n\n- negotiate use of extended FPIN events with NPIV (VIOS)\n- add code to parse and handle extended FPIN events\n- add KUnit test to test extended FPIN event handling\n---\n drivers/scsi/ibmvscsi/ibmvfc.c       | 45 ++++++++++++++---\n drivers/scsi/ibmvscsi/ibmvfc.h       | 31 ++++++++++++\n drivers/scsi/ibmvscsi/ibmvfc_kunit.c | 97 +++++++++++++++++++++++++++++++++---\n 3 files changed, 161 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c\nindex 26e39b367022..5b2b861a34c2 100644\n--- a/drivers/scsi/ibmvscsi/ibmvfc.c\n+++ b/drivers/scsi/ibmvscsi/ibmvfc.c\n@@ -1472,6 +1472,9 @@ static void ibmvfc_gather_partition_info(struct ibmvfc_host *vhost)\n }\n \n static __be64 ibmvfc_npiv_chan_caps[] = {\n+\tcpu_to_be64(IBMVFC_CAN_USE_CHANNELS | IBMVFC_USE_ASYNC_SUBQ |\n+\t\t    IBMVFC_YES_SCSI | IBMVFC_CAN_HANDLE_FPIN |\n+\t\t    IBMVFC_CAN_HANDLE_FPIN_EXT),\n \tcpu_to_be64(IBMVFC_CAN_USE_CHANNELS | IBMVFC_USE_ASYNC_SUBQ |\n \t\t    IBMVFC_YES_SCSI | IBMVFC_CAN_HANDLE_FPIN),\n \tcpu_to_be64(IBMVFC_CAN_USE_CHANNELS),\n@@ -3370,6 +3373,28 @@ ibmvfc_full_fpin_to_desc(struct ibmvfc_async_subq *ibmvfc_fpin)\n \t\t\t\t\t  cpu_to_be32(1));\n }\n \n+/**\n+ * ibmvfc_ext_fpin_to_desc(): allocate and populate a struct fc_els_fpin struct\n+ * containing a descriptor.\n+ * @ibmvfc_fpin: Pointer to async subq FPIN data\n+ *\n+ * Allocate a struct fc_els_fpin containing a descriptor and populate\n+ * based on data from *ibmvfc_fpin.\n+ *\n+ * Return:\n+ * NULL     - unable to allocate structure\n+ * non-NULL - pointer to populated struct fc_els_fpin\n+ */\n+static struct fc_els_fpin *\n+ibmvfc_ext_fpin_to_desc(struct ibmvfc_async_subq_fpin *ibmvfc_fpin)\n+{\n+\treturn ibmvfc_common_fpin_to_desc(ibmvfc_fpin->fpin_status, ibmvfc_fpin->wwpn,\n+\t\t\t\t\t  ibmvfc_fpin->fpin_data.event_type_modifier,\n+\t\t\t\t\t  ibmvfc_fpin->fpin_data.event_threshold,\n+\t\t\t\t\t  ibmvfc_fpin->fpin_data.event_threshold,\n+\t\t\t\t\t  ibmvfc_fpin->fpin_data.event_data.event_count);\n+}\n+\n /**\n  * ibmvfc_handle_async - Handle an async event from the adapter\n  * @crq:\tcrq to process\n@@ -3491,10 +3516,12 @@ VISIBLE_IF_KUNIT void ibmvfc_handle_asyncq(struct ibmvfc_crq *crq_instance,\n \t\t\t\t\t   struct ibmvfc_host *vhost,\n \t\t\t\t\t   struct list_head *evt_doneq)\n {\n+\tstruct ibmvfc_async_subq_fpin *sqfpin = (struct ibmvfc_async_subq_fpin *)crq_instance;\n \tstruct ibmvfc_async_subq *crq = (struct ibmvfc_async_subq *)crq_instance;\n \tconst struct ibmvfc_async_desc *desc = ibmvfc_get_ae_desc(be16_to_cpu(crq->event));\n \tstruct ibmvfc_target *tgt;\n \tstruct fc_els_fpin *fpin;\n+\tu8 fpin_status;\n \n \tibmvfc_log(vhost, desc->log_level,\n \t\t   \"%s event received. wwpn: %llx, node_name: %llx%s event 0x%x\\n\",\n@@ -3582,7 +3609,17 @@ VISIBLE_IF_KUNIT void ibmvfc_handle_asyncq(struct ibmvfc_crq *crq_instance,\n \t\t\t\tcontinue;\n \t\t\tif (!tgt->rport)\n \t\t\t\tcontinue;\n-\t\t\tfpin = ibmvfc_full_fpin_to_desc(crq);\n+\t\t\tif ((crq->flags & IBMVFC_ASYNC_IS_FPIN_EXT) == 0) {\n+\t\t\t\tfpin = ibmvfc_full_fpin_to_desc(crq);\n+\t\t\t\tfpin_status = crq->fpin_status;\n+\t\t\t} else if (!(sqfpin->fpin_data.flags & IBMVFC_FPIN_EVENT_TYPE_VALID))\n+\t\t\t\tdev_err(vhost->dev, \"Invalid extended FPIN event received\");\n+\t\t\telse if (!ibmvfc_check_caps(vhost, IBMVFC_SUPPORT_FPIN_EXT))\n+\t\t\t\tdev_err(vhost->dev, \"Unexpected extended FPIN event received\");\n+\t\t\telse {\n+\t\t\t\tfpin = ibmvfc_ext_fpin_to_desc(sqfpin);\n+\t\t\t\tfpin_status = sqfpin->fpin_status;\n+\t\t\t}\n \t\t\tif (fpin) {\n \t\t\t\tfc_host_fpin_rcv(tgt->vhost->host,\n \t\t\t\t\t\t sizeof(*fpin) + be32_to_cpu(fpin->desc_len),\n@@ -3591,12 +3628,8 @@ VISIBLE_IF_KUNIT void ibmvfc_handle_asyncq(struct ibmvfc_crq *crq_instance,\n \t\t\t} else\n \t\t\t\tdev_err(vhost->dev,\n \t\t\t\t\t\"FPIN event %u received, unable to process\\n\",\n-\t\t\t\t\tcrq->fpin_status);\n+\t\t\t\t\tfpin_status);\n \t\t}\n-\t\tbreak;\n-\tdefault:\n-\t\tdev_err(vhost->dev, \"Unknown async event received: %d\\n\", crq->event);\n-\t\tbreak;\n \t}\n }\n EXPORT_SYMBOL_IF_KUNIT(ibmvfc_handle_asyncq);\ndiff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h\nindex b9f22613d144..c67db8d7b3fc 100644\n--- a/drivers/scsi/ibmvscsi/ibmvfc.h\n+++ b/drivers/scsi/ibmvscsi/ibmvfc.h\n@@ -186,6 +186,7 @@ struct ibmvfc_npiv_login {\n #define IBMVFC_YES_SCSI\t\t\t0x40\n #define IBMVFC_USE_ASYNC_SUBQ\t\t0x100\n #define IBMVFC_CAN_USE_NOOP_CMD\t\t0x200\n+#define IBMVFC_CAN_HANDLE_FPIN_EXT\t0x800\n \t__be64 node_name;\n \tstruct srp_direct_buf async;\n \tu8 partition_name[IBMVFC_MAX_NAME];\n@@ -236,6 +237,7 @@ struct ibmvfc_npiv_login_resp {\n #define IBMVFC_SUPPORT_SCSI\t\t0x200\n #define IBMVFC_SUPPORT_ASYNC_SUBQ\t0x800\n #define IBMVFC_SUPPORT_NOOP_CMD\t\t0x1000\n+#define IBMVFC_SUPPORT_FPIN_EXT\t\t0x2000\n \t__be32 max_cmds;\n \t__be32 scsi_id_sz;\n \t__be64 max_dma_len;\n@@ -718,6 +720,7 @@ struct ibmvfc_async_crq {\n struct ibmvfc_async_subq {\n \tvolatile u8 valid;\n #define IBMVFC_ASYNC_ID_IS_ASSOC_ID\t0x01\n+#define IBMVFC_ASYNC_IS_FPIN_EXT\t0x02\n #define IBMVFC_FC_EEH\t\t\t0x04\n #define IBMVFC_FC_FW_UPDATE\t\t0x08\n #define IBMVFC_FC_FW_DUMP\t\t0x10\n@@ -734,6 +737,34 @@ struct ibmvfc_async_subq {\n \t} id;\n } __packed __aligned(8);\n \n+struct ibmvfc_fpin_data {\n+#define IBMVFC_FPIN_EVENT_TYPE_VALID\t0x01\n+#define IBMVFC_FPIN_MODIFIER_VALID\t0x02\n+#define IBMVFC_FPIN_THRESHOLD_VALID\t0x04\n+#define IBMVFC_FPIN_SEVERITY_VALID\t0x08\n+#define IBMVFC_FPIN_EVENT_COUNT_VALID\t0x10\n+\tu8 flags;\n+\tu8 reserved[3];\n+\t__be16 event_type;\n+\t__be16 event_type_modifier;\n+\t__be32 event_threshold;\n+\tunion {\n+\t\tu8 severity;\n+\t\t__be32 event_count;\n+\t} event_data;\n+} __packed __aligned(8);\n+\n+struct ibmvfc_async_subq_fpin {\n+\tvolatile u8 valid;\n+\tu8 flags;\n+\tu8 link_state;\n+\tu8 fpin_status;\n+\t__be16 event;\n+\t__be16 pad;\n+\tvolatile __be64 wwpn;\n+\tstruct ibmvfc_fpin_data fpin_data;\n+} __packed __aligned(8);\n+\n union ibmvfc_iu {\n \tstruct ibmvfc_mad_common mad_common;\n \tstruct ibmvfc_npiv_login_mad npiv_login;\ndiff --git a/drivers/scsi/ibmvscsi/ibmvfc_kunit.c b/drivers/scsi/ibmvscsi/ibmvfc_kunit.c\nindex 3a41127c4e81..6c2a7d6f8042 100644\n--- a/drivers/scsi/ibmvscsi/ibmvfc_kunit.c\n+++ b/drivers/scsi/ibmvscsi/ibmvfc_kunit.c\n@@ -3,6 +3,7 @@\n #include <kunit/visibility.h>\n #include <scsi/scsi_device.h>\n #include <scsi/scsi_transport_fc.h>\n+#include <scsi/fc/fc_els.h>\n #include <linux/list.h>\n #include \"ibmvfc.h\"\n \n@@ -71,6 +72,25 @@ static void ibmvfc_handle_fpin_event_test(struct kunit *test)\n \tibmvfc_handle_asyncq((struct ibmvfc_crq *)&crq, vhost, &evt_doneq);\n }\n \n+/**\n+ * ibmvfc_async_subq_test - unit test for allocating async subqueue\n+ * @test: pointer to kunit structure\n+ *\n+ * Return: void\n+ */\n+static void ibmvfc_async_subq_test(struct kunit *test)\n+{\n+\tstruct ibmvfc_host *vhost;\n+\tstruct list_head *queue;\n+\tstruct list_head *headp;\n+\n+\theadp = ibmvfc_get_headp();\n+\tqueue = headp->next;\n+\tvhost = container_of(queue, struct ibmvfc_host, queue);\n+\n+\tKUNIT_EXPECT_NOT_NULL(test, vhost->scsi_scrqs.async_scrq);\n+}\n+\n /**\n  * ibmvfc_noop_test - unit test for VFC_NOOP command\n  * @test: pointer to kunit structure\n@@ -97,29 +117,94 @@ static void ibmvfc_noop_test(struct kunit *test)\n \tibmvfc_handle_crq(&crq, vhost, &evtq);\n }\n \n+#define IBMVFC_TEST_FPIN_EXT(fs, ev, stat) {\t\t\t\\\n+\tcrq.valid = 0x80;\t\t\t\t\t\\\n+\tcrq.flags = IBMVFC_ASYNC_IS_FPIN_EXT;\t\t\t\\\n+\tcrq.link_state = IBMVFC_AE_LS_LINK_UP;\t\t\t\\\n+\tcrq.fpin_status = (fs);\t\t\t\t\t\\\n+\tcrq.event = cpu_to_be16(IBMVFC_AE_FPIN);\t\t\\\n+\tcrq.wwpn = cpu_to_be64(tgt->wwpn);\t\t\t\\\n+\tcrq.fpin_data.flags = IBMVFC_FPIN_EVENT_TYPE_VALID;\t\\\n+\tcrq.fpin_data.event_type = cpu_to_be16((ev));\t\t\\\n+\tpre = READ_ONCE(tgt->rport->fpin_stats.stat);\t\t\\\n+\tibmvfc_handle_asyncq((struct ibmvfc_crq *)&crq, vhost,\t\\\n+\t\t\t     &evt_doneq);\t\t\t\\\n+\tpost = READ_ONCE(tgt->rport->fpin_stats.stat);\t\t\\\n+}\n+\n /**\n- * ibmvfc_async_subq_test - unit test for allocating async subqueue\n+ * ibmvfc_extended_fpin_test - unit test for extended FPIN events\n  * @test: pointer to kunit structure\n  *\n+ * Tests\n+ *\n  * Return: void\n  */\n-static void ibmvfc_async_subq_test(struct kunit *test)\n+static void ibmvfc_extended_fpin_test(struct kunit *test)\n {\n+\tenum ibmvfc_ae_fpin_status fs;\n+\tstruct ibmvfc_async_subq_fpin crq;\n+\tstruct fc_fpin_stats stats;\n+\tstruct ibmvfc_target *tgt;\n \tstruct ibmvfc_host *vhost;\n-\tstruct list_head *queue;\n \tstruct list_head *headp;\n+\tLIST_HEAD(evt_doneq);\n+\tu64 pre, post;\n \n \theadp = ibmvfc_get_headp();\n-\tqueue = headp->next;\n-\tvhost = container_of(queue, struct ibmvfc_host, queue);\n+\tvhost = list_first_entry(headp, struct ibmvfc_host, queue);\n+\tKUNIT_ASSERT_NOT_NULL_MSG(test, vhost, \"No vhost\");\n \n-\tKUNIT_EXPECT_NOT_NULL(test, vhost->scsi_scrqs.async_scrq);\n+\tKUNIT_ASSERT_GE(test, vhost->num_targets, 1);\n+\ttgt = list_first_entry(&vhost->targets, struct ibmvfc_target, queue);\n+\tKUNIT_ASSERT_NOT_NULL(test, tgt->rport);\n+\n+\tstats = tgt->rport->fpin_stats;\n+\n+\tfor (fs = IBMVFC_AE_FPIN_LINK_CONGESTED; fs <= IBMVFC_AE_FPIN_CONGESTION_CLEARED; fs++) {\n+\t\tswitch (fs) {\n+\t\tcase IBMVFC_AE_FPIN_PORT_CLEARED:\n+\t\tcase IBMVFC_AE_FPIN_CONGESTION_CLEARED:\n+\t\t\tcrq.valid = 0x80;\n+\t\t\tcrq.flags = IBMVFC_ASYNC_IS_FPIN_EXT;\n+\t\t\tcrq.link_state = IBMVFC_AE_LS_LINK_UP;\n+\t\t\tcrq.fpin_status = fs;\n+\t\t\tcrq.event = cpu_to_be16(IBMVFC_AE_FPIN);\n+\t\t\tcrq.wwpn = cpu_to_be64(tgt->wwpn);\n+\t\t\tcrq.fpin_data.flags = IBMVFC_FPIN_EVENT_TYPE_VALID;\n+\t\t\tcrq.fpin_data.event_type = cpu_to_be16(0);\n+\t\t\tpre = READ_ONCE(tgt->rport->fpin_stats.cn_clear);\n+\t\t\tibmvfc_handle_asyncq((struct ibmvfc_crq *)&crq, vhost,\n+\t\t\t\t\t     &evt_doneq);\n+\t\t\tpost = READ_ONCE(tgt->rport->fpin_stats.cn_clear);\n+\t\t\tbreak;\n+\t\tcase IBMVFC_AE_FPIN_LINK_CONGESTED:\n+\t\tcase IBMVFC_AE_FPIN_PORT_CONGESTED:\n+\t\t\tIBMVFC_TEST_FPIN_EXT(fs, FPIN_CONGN_CLEAR, cn_clear);\n+\t\t\tIBMVFC_TEST_FPIN_EXT(fs, FPIN_CONGN_LOST_CREDIT, cn_lost_credit);\n+\t\t\tIBMVFC_TEST_FPIN_EXT(fs, FPIN_CONGN_CREDIT_STALL, cn_credit_stall);\n+\t\t\tIBMVFC_TEST_FPIN_EXT(fs, FPIN_CONGN_OVERSUBSCRIPTION, cn_oversubscription);\n+\t\t\tIBMVFC_TEST_FPIN_EXT(fs, FPIN_CONGN_DEVICE_SPEC, cn_device_specific);\n+\t\t\tbreak;\n+\t\tcase IBMVFC_AE_FPIN_PORT_DEGRADED:\n+\t\t\tIBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_UNKNOWN, li_failure_unknown);\n+\t\t\tIBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_LINK_FAILURE, li_link_failure_count);\n+\t\t\tIBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_LOSS_OF_SYNC, li_loss_of_sync_count);\n+\t\t\tIBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_LOSS_OF_SIG, li_loss_of_signals_count);\n+\t\t\tIBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_PRIM_SEQ_ERR, li_prim_seq_err_count);\n+\t\t\tIBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_INVALID_TX_WD, li_invalid_tx_word_count);\n+\t\t\tIBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_INVALID_CRC, li_invalid_crc_count);\n+\t\t\tIBMVFC_TEST_FPIN_EXT(fs, FPIN_LI_DEVICE_SPEC, li_device_specific);\n+\t\t\tbreak;\n+\t\t}\n+\t}\n }\n \n static struct kunit_case ibmvfc_fpin_test_cases[] = {\n \tKUNIT_CASE(ibmvfc_handle_fpin_event_test),\n \tKUNIT_CASE(ibmvfc_noop_test),\n \tKUNIT_CASE(ibmvfc_async_subq_test),\n+\tKUNIT_CASE(ibmvfc_extended_fpin_test),\n \t{},\n };\n \n",
    "prefixes": [
        "5/5"
    ]
}