From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796071127; b=wI2+d6MJ6A3DGKfshC57QKJ6nOhmlzxFvX5iSs7CYBCHKaca7970ZPaQAMsmbNDxF2t1 Y1Sl2JvLDVn6DZDkQuyjy45BodO6Qx/N4reTEDFDNTng9v2H0IEA52tkohjASsBfw59wJ VBC8VzVb2EIcW4huWE+lwV9beyKMzmXGB1/BLA9xJC/HPO79AklD1RUtSH+A449sLq07Z /7lWdNLNkU29DCjs2K6qq8FQlYq3OWetvxZO+N6kj+6IoKAIm9r2H896MQ7cJulA/ocpA AwTA7sWiaAahMCCHdY/eecOlzo6wTLouxAOoZJrC1FCkMMzJ1tBSj5xzLKUIH+ExoiA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796071127; h=DMARC-Filter:Received:DKIM-Signature:Received:Received:Received: Received:Received:Received:Received:From:To:Cc:Subject:In-Reply-To: References:Date:Message-ID:User-Agent:MIME-Version:Content-Type: X-TM-AS-GCONF:X-Proofpoint-Spam-Info:X-Proofpoint-ORIG-GUID: X-Proofpoint-GUID:X-Authority-Analysis:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=6U1QNbvI/HUtBLub7zXo26EQVKJRbixppe/4gq5RlWg=; b=gEmP1LzY73ErD0j/c3k9R5UJLppYG9J9lbqjtDyqMV2tmSHPwQ/0+YhrejZlBPQ+48G5 OVwEKYaiLegeo4bHUOcRdL1o62J5xyQhtxF/VBfurDnFDluv16SD31JsOaCpZdJ6JYhkb duVvmhA71OA44yFyWNK1T1p3PEwN5te3qgY2oz9a4sCBqNrRo8GSbFPfLNwWCs2mfSEVZ WuKJngMUdM5ZANjsrP/bifOny581TF7zmwguhHRaJ4JQ333F61Y5uFdai1Y8XYu0+jWmI j5/JP5Kj4aSI1jtPALABeGCplxJpSTbKYxpLrM79vIjdSQKt/k+XKV+B8A1HdsN2EJg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=dxsO97Jf; arc=none smtp.remote-ip=148.163.156.1 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B68F606A31A; Mon, 30 Nov 2026 20:38:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1B68F606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=dxsO97Jf Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AUI4cvR3972012; Mon, 30 Nov 2026 20:38:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=pp1; bh=6U1QNbvI/HUtBLub7zXo26EQVKJRbi xppe/4gq5RlWg=; b=dxsO97JffBuY0dALZEUFCsk/okyH3NOBwSgqWgOpQVOf77 yLiZKMjKt1dkxb6mZl+ztJtfY5yULgWYDM7RtqiH4y8wf3KXZ7psfc81caEzU2VI 8I3FQYCBV4I6xlpZOJQ6oy6NHbdOsEylLF8ajAJHw9idpSi1IjPxQ1GlRS9dTOZT PpTCDAPcqGZFmg09r9lRpzWc3MuWOR+k6fmsK67b5z84mSzGHjHEHOS9ZmIbfHIj uWUG4JUmuWa+ltW1hB4DxGzxNzvOvlhDbShBBuO8UJeEpbplZvqTw8RC019sptfE CsTPhT3dr80CHhZcpzZoNQ83CRFgRuPtOt74HqaA== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4j7pf3suv2-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 30 Nov 2026 20:38:46 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 6AUHomvf1444911; Mon, 30 Nov 2026 20:38:45 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4j8asgpden-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Nov 2026 20:38:45 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (smtpav01.wdc07v.mail.ibm.com [10.39.53.228]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6AUKciAO18416136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Nov 2026 20:38:44 GMT Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0FA4858066; Mon, 30 Nov 2026 20:38:44 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CE5A658063; Mon, 30 Nov 2026 20:38:43 +0000 (GMT) Received: from e (unknown [9.16.46.225]) by smtpav01.wdc07v.mail.ibm.com (Postfix) with ESMTPS; Mon, 30 Nov 2026 20:38:43 +0000 (GMT) From: Dave Marquardt To: sashiko-reviews@lists.linux.dev Cc: linux-scsi@vger.kernel.org Subject: Re: [PATCH v19 12/13] scsi: ibmvfc: register and use asynchronous sub CRQ for events In-Reply-To: References: <20261124-ibmvfc-fpin-support-v19-0-2aaffe5fe7d2@linux.ibm.com> <20261124-ibmvfc-fpin-support-v19-12-2aaffe5fe7d2@linux.ibm.com> Date: Mon, 30 Nov 2026 14:38:43 -0600 Message-ID: <87h5gyawbw.fsf@linux.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Info: AW1haW4tMjYxMTMwMDA4MiBTYWx0ZWRfX++jcIHxcyjWv Ekk4xczcKXSB83pWBMul4FesKRAISmDPfCWsnVsnLeNSpDFqJaH9rVWgEbjiacxqhspwkqaElrV Ukf7F+cmTEpzZMdU9rC6fhFAfB94AJQ= X-Proofpoint-ORIG-GUID: ukOIVLOf588uDLaAInie1W9yBKtOGASL X-Proofpoint-GUID: ukOIVLOf588uDLaAInie1W9yBKtOGASL X-Authority-Analysis: v=2.4 cv=R6eWitRX c=1 sm=1 tr=0 ts=6b0dded6 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=zJRp6_cAMcgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=4NjO5PK_zBPTmxcKcLkA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTMwMDA4MiBTYWx0ZWRfXxPeOJZ9YibGq uAruVVk7Ni54tIHLMpyCNeh3dw8xX1TcdXovKgyNaqZjB5qOrvuU+CQ4u0wy8rU1o6F0sSgCKZF KAVLCtnPD5i+uV2HweZIeQKDnaUID0BAuh/jGzhuPoUqgMpEbRUbo47d98XhhX1ZIC/QY6wjAWc 4FvNE2fwwGdmuZywUfLXBR9T62fAapp47qqy6tigycwUfEs4se+WZCQF+OfxIdK/+Owcu9CDYlV pUJvxlkv/5j93P3oRUW+7T5KgooLyPrrbUIwTmaQBeAX0xcL8gEqGGpsQAnNsBx0/+F3+/Ulckd wWyjuZFsNYksU03W+tq/C5KTMKdLrqo9NEaNiYbld8dG6uiMj/hlN9B12rZLy7EW8cD3/8KoyB0 EZdmMOIWfNKqdDF4wkPgGDSPHo950WGw3fJJFJJ4ttr5XzXMskEy09Cqc3HImSN8L0yTyFzaf4m ai5TK2IeGGBIsFYslvg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-30_05,2026-11-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 spamscore=0 bulkscore=0 phishscore=0 suspectscore=0 malwarescore=0 clxscore=1015 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611300082 sashiko-bot@kernel.org writes: > Thank you for your contribution! Sashiko AI review found 1 potential > issue to consider: > - [Medium] scsi: ibmvfc: skipped async vios_cookie setup in > ibmvfc_channel_setup_done() > -- > > commit 3e247869161ac30df00b0fd2f408f7ef73973ecb > Author: Dave Marquardt > > scsi: ibmvfc: register and use asynchronous sub CRQ for events > > This commit wires the asynchronous sub-CRQ into the ibmvfc channel allocation, > registration, setup, and teardown lifecycle, and advertises async sub-CRQ > support during NPIV login when multi-queue channels are enabled. > >> diff --git a/drivers/scsi/ibmvscsi/ibmvfc-core.c b/drivers/scsi/ibmvscsi/ibmvfc-core.c >> index 5e8b25673ff5d..f478f10f93ffc 100644 >> --- a/drivers/scsi/ibmvscsi/ibmvfc-core.c >> +++ b/drivers/scsi/ibmvscsi/ibmvfc-core.c > > [ ... ] > >> @@ -5912,6 +5940,7 @@ static void ibmvfc_channel_setup_done(struct ibmvfc_event *evt) >> { >> struct ibmvfc_host *vhost = evt->vhost; >> struct ibmvfc_channel_setup *setup = vhost->channel_setup_buf; >> + struct ibmvfc_channels *async = &vhost->async_scrqs; >> struct ibmvfc_channels *scsi = &vhost->scsi_scrqs; >> struct ibmvfc_channels *nvme = &vhost->nvme_scrqs; >> u32 mad_status = be16_to_cpu(evt->xfer_iu->channel_setup.common.status); >> @@ -5925,8 +5954,12 @@ static void ibmvfc_channel_setup_done(struct ibmvfc_event *evt) >> ibmvfc_dbg(vhost, "Channel Setup succeeded\n"); >> flags = be32_to_cpu(setup->flags); >> vhost->do_enquiry = 0; >> - scsi->active_queues = be32_to_cpu(setup->num_scsi_subq_channels); >> - nvme->active_queues = be32_to_cpu(setup->num_nvme_subq_channels); >> + scsi->active_queues = min(be32_to_cpu(setup->num_scsi_subq_channels), >> + scsi->max_queues); >> + nvme->active_queues = nvme->scrqs ? >> + min(be32_to_cpu(setup->num_nvme_subq_channels), >> + nvme->max_queues) : 0; >> + async->active_queues = (async->scrqs && setup->async_sub_crq_handle) ? 1 : 0; >> >> if (flags & IBMVFC_CHANNELS_CANCELED) { >> ibmvfc_dbg(vhost, "Channels Canceled\n"); >> @@ -5942,6 +5975,8 @@ static void ibmvfc_channel_setup_done(struct ibmvfc_event *evt) >> for (i = 0; i < nvme->active_queues; i++) >> nvme->scrqs[i].vios_cookie = >> be64_to_cpu(setup->channel_handles[scsi->active_queues + i]); >> + for (i = 0; i < async->active_queues; i++) >> + async->scrqs[i].vios_cookie = be64_to_cpu(setup->async_sub_crq_handle); > > [Severity: Medium] > Does breaking out on IBMVFC_CHANNELS_CANCELED skip setting > async->scrqs[0].vios_cookie while leaving async->active_queues set to 1? > > When scsi_channels and nvme_channels are both 0, ibmvfc_channel_setup() > sets IBMVFC_CANCEL_CHANNELS and still populates > setup_buf->async_sub_crq_handle so the async sub-CRQ can be used. > However, when the response returns with IBMVFC_CHANNELS_CANCELED set, the > break in ibmvfc_channel_setup_done() jumps over the loop that stores > setup->async_sub_crq_handle in async->scrqs[0].vios_cookie, leaving > vios_cookie uninitialized or stale. It also leaves scsi->active_queues > and nvme->active_queues unzeroed if the response contains non-zero counts. I agree this is an inconsistent state. IBMVFC_CANCEL_CHANNELS also cancels the async sub-queue, so after IBMVFC_CHANNELS_CANCELED the async sub-CRQ isn't usable and shouldn't be marked active. v20 will clear the async, SCSI, and MVE channel sets that code branch. Nothing consumes the async cookie today, and the SCSI/NVMe readers are guarded by us ing_channels, so this was a stale-state issue rather than an observed failure. -Dave