Message ID | 20221213154437.15480-6-akrowiak@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp200128wrn; Tue, 13 Dec 2022 07:50:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf6JLRt/HBiHHiww3ObyfoRb7QSIB2MszPhqjv1wLmzONlMudnSL3a5+Y5Z2cQN+AWSRciXf X-Received: by 2002:a05:6a20:d48f:b0:9d:efbe:a0f5 with SMTP id im15-20020a056a20d48f00b0009defbea0f5mr25662556pzb.5.1670946629483; Tue, 13 Dec 2022 07:50:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670946629; cv=none; d=google.com; s=arc-20160816; b=nWqAh1tkaWpmhsku35suix2z+OYIhCgsQq6I8Xs4LuiJvFnXaRaghBL6NT7noh0rBU PvbeinWpbEINJbv/Q6NNVLMFalUV1ZiRD+ixfLSxr4Uyt+pkFSHlaxDRN3w6Bhy7Nc05 uyxDMlqDMCcXoDkJZtwlLQlF1vk1UU21b3pfjTno/8NeVSpSTKb8vwHuHgsZ8r8xQv3m vl1pjKc1vgLZrcUFeX5wobanFUkxW/p41YuJnngdxz7Igr6TUF3x9DkvVCKdTEWEG3Sd IGyUMejBBmDbxWJYXEFRQ8bly+QXLaeXMFyfCAQ0ZorXrHPBZzO72ZFXSz9HW9kmdF+F aJyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/HQeFvFXqFV0XM1oj4U79Hhc3J2Khc8fBjlo8EEXLU0=; b=WwlEr9RbN7XzkA8+Nsnpj6blq0bSBeT992k4zbyFFGPrqsGj2GDQOtc2n6XsqPfkqS asmShj0QwxQscKCy2Yb7PT3Nk4PJvi9BPgwJosbsHM1BxvquT2r5rpwgwbB/15p4A9pL 4LbQW3vmWzVW3U7Gi+VZc3jgAJdRTmLQk4S63/7c9rFpsaA5l1qMDWkbOs+TzqIPsPDN jQUJigND43dq49IJ/RFZ+zbKM46Fuz+Y1V8TV/6NywZQ2Prp2aDT9ZKQBB9tEZlsEsAv RlYDfPLiN9YV8UhfrmSt9gzELxLrpxFU2YcadN6tY2PiFqkZfP3/Uo5SoxsIdj5T+yGj tLSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=rCFXxpzE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f67-20020a636a46000000b00476e62744a8si13039130pgc.388.2022.12.13.07.50.15; Tue, 13 Dec 2022 07:50:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=rCFXxpzE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236319AbiLMPpW (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Tue, 13 Dec 2022 10:45:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236294AbiLMPow (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 13 Dec 2022 10:44:52 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C7E6DEE; Tue, 13 Dec 2022 07:44:49 -0800 (PST) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BDFPk3o025564; Tue, 13 Dec 2022 15:44:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=/HQeFvFXqFV0XM1oj4U79Hhc3J2Khc8fBjlo8EEXLU0=; b=rCFXxpzEgJtvIJMvYKEki+51wPlzpD5luGAlc1YzJ9MvfcgSoLEkruEds5Y4gy8TWBVb qjFTciQ5a3UgiDFNQd2zR4ZkzM4lzb8FGxyi9PZylVpXoqJlKRtfuwcXX/f+aZd29jTg 3Q2SiQBybMyNn8Nb6/BEvoTGekgk0uqdIOchm7rl1hgWASp9/XR6hvP3qPGVy7REAh3D 5iH4dJGWD1+ykOKb8bZ6n9mPS1Mbr3F6xNDjMGguaa7BvzvZ6fVkKqTFkBjxZoLAt4XG wnU81njjZw1lHPqHdWjbJFveI//MJRh9kIG1YXNXBHHwWvsQ0qmtvcH4ObSRW/xbSF8M Lg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mev1drke0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Dec 2022 15:44:46 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2BDFRen9004108; Tue, 13 Dec 2022 15:44:46 GMT Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mev1drkdk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Dec 2022 15:44:46 +0000 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 2BDDhTav007534; Tue, 13 Dec 2022 15:44:45 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([9.208.129.119]) by ppma04wdc.us.ibm.com (PPS) with ESMTPS id 3mchr6mahp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Dec 2022 15:44:45 +0000 Received: from smtpav01.dal12v.mail.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2BDFihEt36831664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Dec 2022 15:44:43 GMT Received: from smtpav01.dal12v.mail.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 126AD58061; Tue, 13 Dec 2022 15:44:43 +0000 (GMT) Received: from smtpav01.dal12v.mail.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 431AC58057; Tue, 13 Dec 2022 15:44:42 +0000 (GMT) Received: from li-2c1e724c-2c76-11b2-a85c-ae42eaf3cb3d.endicott.ibm.com (unknown [9.60.85.43]) by smtpav01.dal12v.mail.com (Postfix) with ESMTP; Tue, 13 Dec 2022 15:44:42 +0000 (GMT) From: Tony Krowiak <akrowiak@linux.ibm.com> To: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: jjherne@linux.ibm.com, freude@linux.ibm.com, borntraeger@de.ibm.com, cohuck@redhat.com, mjrosato@linux.ibm.com, pasic@linux.ibm.com, alex.williamson@redhat.com, kwankhede@nvidia.com, fiuczy@linux.ibm.com Subject: [PATCH 5/7] s390/vfio_ap: fix handling of error response codes Date: Tue, 13 Dec 2022 10:44:35 -0500 Message-Id: <20221213154437.15480-6-akrowiak@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221213154437.15480-1-akrowiak@linux.ibm.com> References: <20221213154437.15480-1-akrowiak@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 60Bbzj8n0Xmo-tq8yaMQBoTDtDz7-ier X-Proofpoint-GUID: Xk6xYjLMjVrN-0e5DWApVh4e2gRCVC_9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-13_03,2022-12-13_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=999 impostorscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 mlxscore=0 phishscore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212130137 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752114532825553823?= X-GMAIL-MSGID: =?utf-8?q?1752114532825553823?= |
Series |
improve AP queue reset processing
|
|
Commit Message
Anthony Krowiak
Dec. 13, 2022, 3:44 p.m. UTC
Some response codes returned from the queue reset function are not being
handled correctly; this patch fixes them:
1. Response code 3, AP queue deconfigured: Deconfiguring an AP adapter
resets all of its queues, so this is handled by indicating the reset
verification completed successfully.
2. For all response codes other than 0 (normal reset completion), 2
(queue reset in progress) and 3 (AP deconfigured), the -EIO error will
be returned from the vfio_ap_mdev_reset_queue() function. In all cases,
all fields of the status word other than the response code will be
set to zero, so it makes no sense to check status bits.
Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
---
drivers/s390/crypto/vfio_ap_ops.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
Comments
On 2022-12-13 16:44, Tony Krowiak wrote: > Some response codes returned from the queue reset function are not > being > handled correctly; this patch fixes them: > > 1. Response code 3, AP queue deconfigured: Deconfiguring an AP adapter > resets all of its queues, so this is handled by indicating the reset > verification completed successfully. > > 2. For all response codes other than 0 (normal reset completion), 2 > (queue reset in progress) and 3 (AP deconfigured), the -EIO error > will > be returned from the vfio_ap_mdev_reset_queue() function. In all > cases, > all fields of the status word other than the response code will be > set to zero, so it makes no sense to check status bits. > > Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com> > --- > drivers/s390/crypto/vfio_ap_ops.c | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) > > diff --git a/drivers/s390/crypto/vfio_ap_ops.c > b/drivers/s390/crypto/vfio_ap_ops.c > index c0cf5050be59..dbf681715a6d 100644 > --- a/drivers/s390/crypto/vfio_ap_ops.c > +++ b/drivers/s390/crypto/vfio_ap_ops.c > @@ -1659,17 +1659,15 @@ static int vfio_ap_mdev_reset_queue(struct > vfio_ap_queue *q) > if (ret) > break; > goto retry_zapq; > - case AP_RESPONSE_Q_NOT_AVAIL: > case AP_RESPONSE_DECONFIGURED: > - case AP_RESPONSE_CHECKSTOPPED: > - WARN_ONCE(status.irq_enabled, > - "PQAP/ZAPQ for %02x.%04x failed with rc=%u while IRQ enabled", > - AP_QID_CARD(q->apqn), AP_QID_QUEUE(q->apqn), > - status.response_code); > - ret = -EBUSY; > - goto free_resources; > + /* > + * When an AP adapter is deconfigured, the associated > + * queues are reset, so let's return a value indicating the reset > + * completed successfully. > + */ > + ret = 0; > + break; > default: > - /* things are really broken, give up */ > WARN(true, > "PQAP/ZAPQ for %02x.%04x failed with invalid rc=%u\n", > AP_QID_CARD(q->apqn), AP_QID_QUEUE(q->apqn), > @@ -1677,7 +1675,6 @@ static int vfio_ap_mdev_reset_queue(struct > vfio_ap_queue *q) > return -EIO; > } > > -free_resources: > vfio_ap_free_aqic_resources(q); > > return ret; Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
On 12/15/22 5:56 AM, Harald Freudenberger wrote: > On 2022-12-13 16:44, Tony Krowiak wrote: >> Some response codes returned from the queue reset function are not being >> handled correctly; this patch fixes them: >> >> 1. Response code 3, AP queue deconfigured: Deconfiguring an AP adapter >> resets all of its queues, so this is handled by indicating the reset >> verification completed successfully. >> >> 2. For all response codes other than 0 (normal reset completion), 2 >> (queue reset in progress) and 3 (AP deconfigured), the -EIO error >> will >> be returned from the vfio_ap_mdev_reset_queue() function. In all >> cases, >> all fields of the status word other than the response code will be >> set to zero, so it makes no sense to check status bits. >> >> Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com> >> --- >> drivers/s390/crypto/vfio_ap_ops.c | 17 +++++++---------- >> 1 file changed, 7 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/s390/crypto/vfio_ap_ops.c >> b/drivers/s390/crypto/vfio_ap_ops.c >> index c0cf5050be59..dbf681715a6d 100644 >> --- a/drivers/s390/crypto/vfio_ap_ops.c >> +++ b/drivers/s390/crypto/vfio_ap_ops.c >> @@ -1659,17 +1659,15 @@ static int vfio_ap_mdev_reset_queue(struct >> vfio_ap_queue *q) >> if (ret) >> break; >> goto retry_zapq; >> - case AP_RESPONSE_Q_NOT_AVAIL: >> case AP_RESPONSE_DECONFIGURED: >> - case AP_RESPONSE_CHECKSTOPPED: >> - WARN_ONCE(status.irq_enabled, >> - "PQAP/ZAPQ for %02x.%04x failed with rc=%u while IRQ >> enabled", >> - AP_QID_CARD(q->apqn), AP_QID_QUEUE(q->apqn), >> - status.response_code); >> - ret = -EBUSY; >> - goto free_resources; >> + /* >> + * When an AP adapter is deconfigured, the associated >> + * queues are reset, so let's return a value indicating the >> reset >> + * completed successfully. >> + */ >> + ret = 0; >> + break; >> default: >> - /* things are really broken, give up */ >> WARN(true, >> "PQAP/ZAPQ for %02x.%04x failed with invalid rc=%u\n", >> AP_QID_CARD(q->apqn), AP_QID_QUEUE(q->apqn), >> @@ -1677,7 +1675,6 @@ static int vfio_ap_mdev_reset_queue(struct >> vfio_ap_queue *q) >> return -EIO; >> } >> >> -free_resources: >> vfio_ap_free_aqic_resources(q); >> >> return ret; > > Reviewed-by: Harald Freudenberger <freude@linux.ibm.com> Thanks for the review.
diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c index c0cf5050be59..dbf681715a6d 100644 --- a/drivers/s390/crypto/vfio_ap_ops.c +++ b/drivers/s390/crypto/vfio_ap_ops.c @@ -1659,17 +1659,15 @@ static int vfio_ap_mdev_reset_queue(struct vfio_ap_queue *q) if (ret) break; goto retry_zapq; - case AP_RESPONSE_Q_NOT_AVAIL: case AP_RESPONSE_DECONFIGURED: - case AP_RESPONSE_CHECKSTOPPED: - WARN_ONCE(status.irq_enabled, - "PQAP/ZAPQ for %02x.%04x failed with rc=%u while IRQ enabled", - AP_QID_CARD(q->apqn), AP_QID_QUEUE(q->apqn), - status.response_code); - ret = -EBUSY; - goto free_resources; + /* + * When an AP adapter is deconfigured, the associated + * queues are reset, so let's return a value indicating the reset + * completed successfully. + */ + ret = 0; + break; default: - /* things are really broken, give up */ WARN(true, "PQAP/ZAPQ for %02x.%04x failed with invalid rc=%u\n", AP_QID_CARD(q->apqn), AP_QID_QUEUE(q->apqn), @@ -1677,7 +1675,6 @@ static int vfio_ap_mdev_reset_queue(struct vfio_ap_queue *q) return -EIO; } -free_resources: vfio_ap_free_aqic_resources(q); return ret;