All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Marquardt <davemarq@linux.ibm.com>
To: sashiko-reviews@lists.linux.dev
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v7 8/8] scsi: ibmvfc: handle extended FPIN events
Date: Tue, 08 Sep 2026 14:53:29 -0500	[thread overview]
Message-ID: <87y0db1pvq.fsf@linux.ibm.com> (raw)
In-Reply-To: <20260831225604.007591F000E9@smtp.kernel.org>

sashiko-bot@kernel.org writes:

> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The `ibmvfc_extended_fpin_test` test suite is entirely invalid due to missing KUnit assertions and incorrect statistics targeting.
> --
>
> commit 7f2470a8cbfd29182f9253c971ce356e69e43c8e
> Author: Dave Marquardt <davemarq@linux.ibm.com>
>
> scsi: ibmvfc: handle extended FPIN events
>
> Implement support for extended FPIN messages received via the asynchronous 
> sub-queue. Add parsing and processing logic to convert these into 
> fc_els_fpin structures. Include comprehensive KUnit tests to validate the 
> extended FPIN event handling.
>
>> diff --git a/drivers/scsi/ibmvscsi/ibmvfc_kunit.c b/drivers/scsi/ibmvscsi/ibmvfc_kunit.c
>> index 47f7c4e79cd81..b016c7da24cd6 100644
>> --- a/drivers/scsi/ibmvscsi/ibmvfc_kunit.c
>> +++ b/drivers/scsi/ibmvscsi/ibmvfc_kunit.c
>
> [ ... ]
>
>> +#define IBMVFC_TEST_FPIN_EXT(fs, ev, stat, crq) {				\
>> +	struct ibmvfc_async_crq_event ae = { .type = IBMVFC_ASYNC_CRQ_SUB };	\
>> +	(crq).valid = 0x80;							\
>> +	(crq).flags = IBMVFC_ASYNC_IS_FPIN_EXT;					\
>> +	(crq).link_state = IBMVFC_AE_LS_LINK_UP;				\
>> +	(crq).fpin_status = (fs);						\
>> +	(crq).event = cpu_to_be16(IBMVFC_AE_FPIN);				\
>> +	(crq).wwpn = cpu_to_be64(tgt->wwpn);					\
>> +	(crq).fpin_data.flags = IBMVFC_FPIN_EVENT_TYPE_VALID;			\
>> +	(crq).fpin_data.event_type = cpu_to_be16((ev));				\
>> +	ae.subq = *(struct ibmvfc_async_sub_crq *)&(crq);			\
>> +	pre = READ_ONCE(tgt->rport->fpin_stats.stat);				\
>> +	ibmvfc_handle_async(&ae, vhost);					\
>> +	flush_workqueue(vhost->fpin_workq);					\
>> +	post = READ_ONCE(tgt->rport->fpin_stats.stat);				\
>> +}
>
> [Severity: Medium]
> Does this macro actually verify the statistics have changed? It captures the
> pre and post state, but doesn't appear to perform any KUnit assertions
> (like KUNIT_EXPECT_GE) to validate the test results.

This test is about exercising the extended FPIN functionality, and does
not test for correctness. I will add a comment about this in the next
patch revision.

> Additionally, this macro always queries tgt->rport->fpin_stats for all events.
> Is this correct for host-level link congestion events which might update
> fc_host->fpin_stats instead?
>
>> +
>> +/**
>> + * 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;
>
> [ ... ]
>
>> +	for (fs = IBMVFC_AE_FPIN_LINK_CONGESTED; fs <= IBMVFC_AE_FPIN_CONGESTION_CLEARED; fs++) {
>> +		switch (fs) {
>> +		case IBMVFC_AE_FPIN_PORT_CLEARED:
>> +		case IBMVFC_AE_FPIN_CONGESTION_CLEARED: {
>> +			struct ibmvfc_async_crq_event ae = { .type = IBMVFC_ASYNC_CRQ_SUB };
>> +
>> +			crq[fs].valid = 0x80;
>> +			crq[fs].flags = IBMVFC_ASYNC_IS_FPIN_EXT;
>> +			crq[fs].link_state = IBMVFC_AE_LS_LINK_UP;
>> +			crq[fs].fpin_status = fs;
>> +			crq[fs].event = cpu_to_be16(IBMVFC_AE_FPIN);
>> +			crq[fs].wwpn = cpu_to_be64(tgt->wwpn);
>> +			crq[fs].fpin_data.flags = IBMVFC_FPIN_EVENT_TYPE_VALID;
>> +			crq[fs].fpin_data.event_type = cpu_to_be16(FPIN_CONGN_CLEAR);
>> +			ae.subq = *(struct ibmvfc_async_sub_crq *)&crq[fs];
>> +			pre = READ_ONCE(tgt->rport->fpin_stats.cn_clear);
>> +			ibmvfc_handle_async(&ae, vhost);
>> +			flush_workqueue(vhost->fpin_workq);
>> +			post = READ_ONCE(tgt->rport->fpin_stats.cn_clear);
>> +			break;
>> +		}
>
> [Severity: Medium]
> Similar to the macro above, is there a missing KUnit assertion here in
> ibmvfc_extended_fpin_test() to validate that the statistics were properly
> updated?

      reply	other threads:[~2026-09-08 19:53 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 19:00 [PATCH v7 0/8] scsi: ibmvfc: make ibmvfc support FPIN messages Dave Marquardt via B4 Relay
2026-08-31 19:00 ` Dave Marquardt
2026-08-31 19:00 ` [PATCH v7 1/8] scsi: ibmvfc: add basic FPIN support Dave Marquardt via B4 Relay
2026-08-31 19:00   ` Dave Marquardt
2026-08-31 21:30   ` sashiko-bot
2026-09-02 20:29     ` Dave Marquardt
2026-09-02 21:59     ` Dave Marquardt
2026-08-31 19:00 ` [PATCH v7 2/8] scsi: ibmvfc: Add NOOP command support Dave Marquardt via B4 Relay
2026-08-31 19:00   ` Dave Marquardt
2026-08-31 21:40   ` sashiko-bot
2026-09-03 15:08     ` Dave Marquardt
2026-08-31 19:00 ` [PATCH v7 3/8] scsi: ibmvfc: add FPIN extended flag and async sub-CRQ queue handle Dave Marquardt via B4 Relay
2026-08-31 19:00   ` Dave Marquardt
2026-08-31 19:00 ` [PATCH v7 4/8] scsi: ibmvfc: extend async event handlers to handle async sub queue events Dave Marquardt via B4 Relay
2026-08-31 19:00   ` Dave Marquardt
2026-08-31 19:00 ` [PATCH v7 5/8] scsi: ibmvfc: add interrupt routine for asynchronous sub CRQ Dave Marquardt via B4 Relay
2026-08-31 19:00   ` Dave Marquardt
2026-08-31 22:18   ` sashiko-bot
2026-09-03 16:18     ` Dave Marquardt
2026-08-31 19:00 ` [PATCH v7 6/8] scsi: ibmvfc: extend channel registration and deregistration for async subq Dave Marquardt via B4 Relay
2026-08-31 19:00   ` Dave Marquardt
2026-08-31 22:34   ` sashiko-bot
2026-09-03 18:43     ` Dave Marquardt
2026-08-31 19:00 ` [PATCH v7 7/8] scsi: ibmvfc: register and use asynchronous sub CRQ for events Dave Marquardt via B4 Relay
2026-08-31 19:00   ` Dave Marquardt
2026-08-31 22:46   ` sashiko-bot
2026-09-08 19:52     ` Dave Marquardt
2026-08-31 19:00 ` [PATCH v7 8/8] scsi: ibmvfc: handle extended FPIN events Dave Marquardt via B4 Relay
2026-08-31 19:00   ` Dave Marquardt
2026-08-31 22:56   ` sashiko-bot
2026-09-08 19:53     ` Dave Marquardt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y0db1pvq.fsf@linux.ibm.com \
    --to=davemarq@linux.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.