Message ID | 1707834358-165470-1-git-send-email-steven.sistare@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-63672-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp572969dyb; Tue, 13 Feb 2024 06:27:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVDgc08baj1MeUNupbh+3+5xJd2hVveUNoyHIGH6GnU0Jt+t80THrce1XB+5/Lawzlp+12xhMO2ccAXWrq4+oVuOeLQ3g== X-Google-Smtp-Source: AGHT+IHRAPElygEe4ORL22wDllKVq+OqSBnbKzIabpFyNq0XDtPvo6ePTImEpes/GFH0bw5Hz5d6 X-Received: by 2002:a17:907:1189:b0:a3c:3af6:722f with SMTP id uz9-20020a170907118900b00a3c3af6722fmr6626320ejb.21.1707834451024; Tue, 13 Feb 2024 06:27:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707834451; cv=pass; d=google.com; s=arc-20160816; b=dfGAxEkMZoEg+aC4OSTAmbp+CFHEqrZSoMsMQ0eNao623uyoBy5H0FNmRGww5EwGOa /UZLej/WvTF1WWOOyUbkAt3BvjYe4rVF/Ovv9R6uvYr5TmQs7LoCBCKRbsbKMqSVv1iT DgJz/NNonCj7u7n3JcIcUsvodBjVjlPe4iyWi18XtxwLStCCHY/2ynHBQ2zYL2BForsj Ksuu7iwAERv0ZnbmJH2/vYHVTAkPGVYsOTY77goYt6p028zdBWaJC5O0+Q41yg/77Hyy BD8TAU2WetBcpqFdY2b7XkQIwnTKY6Xj1XdLql8JObGi0SEGwaaT/rkzWSOG/SiCVYGa E+QQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature; bh=xn+jQYpVDm0LrE2BS/+92v/4tL5PF4w1LwRpKfG4228=; fh=QMEJJekgZGPM1R+XI7vcaiXcpnWIcoRnkNsuLAeFm+I=; b=eynoZHpuVxOOXsUzvMGEANk9RcUUjPWOkVB2Ctym0YUjI1mH27k41x8QG8vlPnia/H ynghXO4xUJ/swlg5tSxsX09fKn7/KHOT6sC5vCrAl2nYOPL0L8fCb+jesAUOvbEmxhKH 5HoDTQNbESX39v9QDkh0o3DDBI30UNBYyl/USnsLKHaUKc30D2/QJRLjKDny2cpMdqod x/qGMlsnZ+HGCz9GAxnu+QRTcsWWVELw+Jc6tGrFRzmXKooYHDODqaDY1Zaagyiscy/C xRfSeDmMGVeWTR9uXJY4gLb4TMxMnBGsk0McaXDfUgY/SArb6oKzKR2pLiF6WSE+NM3g J4FA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=m4wwgZrR; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-63672-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63672-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com X-Forwarded-Encrypted: i=2; AJvYcCUnMIR94r8Btfs0NfVx3SmKF5ocqJSDweid5bTBjAOB2bWfoCKUjSCddRB9ruMUiUXHy70M70YVm2fZW8ZE8EpltA2NFg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id mb8-20020a170906eb0800b00a3d20ec721esi160775ejb.88.2024.02.13.06.27.30 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 06:27:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63672-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=m4wwgZrR; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-63672-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63672-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 49B561F269A3 for <ouuuleilei@gmail.com>; Tue, 13 Feb 2024 14:26:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC43D58136; Tue, 13 Feb 2024 14:26:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="m4wwgZrR" Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (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 71DC958108 for <linux-kernel@vger.kernel.org>; Tue, 13 Feb 2024 14:26:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707834367; cv=none; b=IDtDrpIoTQDBPk5rZ0R/NRsoAtp1S1syPhN2KBGYJR0V/jtdd8oECEk4qavbc6tIBwApmj+ajZBw6kMvsEZKGRDcOqIw5QnXxl7tGrvL+29NQmc3V0rRiZPfLTAgrWGnKE7suby5Pipt10xV14vCb2CSJNlEE09zlgi3/2zwEuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707834367; c=relaxed/simple; bh=5Sxu7vk0RgDuyxfPAVYOqd8ty37LyCj1c00JhxqqCsw=; h=From:To:Cc:Subject:Date:Message-Id; b=bNMfNzuU3hA6rd//JN/h3m2a1mY1spXYf/awflTgUGIJ7znYg6KMDdgq82rX5bmWFK35+9yznFGNA8JDK/kQ1g5JUfIkqetKDkxDX8bqbeE4LBF0WWoD+7ibE0B5VOQxA964OxWuj+X7t2EblG6CKws0gcGY4eU1QZGxMUlNVJ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=m4wwgZrR; arc=none smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41DE1e2R003550; Tue, 13 Feb 2024 14:26:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2023-11-20; bh=xn+jQYpVDm0LrE2BS/+92v/4tL5PF4w1LwRpKfG4228=; b=m4wwgZrRO/vJsAVAP9JvnxBG8a2Ec8fIysDW7PdExgWKlRdM3HR7ZnbjxFEORv9VapYr 3rlzZlUnd6HexgXStnVjdCA8krlqZuSrqXEARafBTspAUCC7Bt+oo6wocNMkeHUJ6plr s1FLaeY3UmxCVsBy8XHzpEmCQUq3SHajzjXhdyz2PpOW66MyJLWrNiBPzMp+YzHC1c0Z YjVHuZJdM5A5Fv1oRgUepM0Tu88TOMuTQ2wFRVqkjAYRah5W5AQSYyTLUPtDXPLRlbcC hv3Gx+5hDyV31VTYfp8NrWDfF+c26rKNK/OAsHE7bcgjt7we5ReV8tIcBAWTVYsGnnzg cw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w89tm82jm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Feb 2024 14:26:00 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41DDDpH0015119; Tue, 13 Feb 2024 14:26:00 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yk7dj41-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Feb 2024 14:26:00 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41DEPxE2036697; Tue, 13 Feb 2024 14:25:59 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3w5yk7dj34-1; Tue, 13 Feb 2024 14:25:59 +0000 From: Steve Sistare <steven.sistare@oracle.com> To: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Cc: "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>, Si-Wei Liu <si-wei.liu@oracle.com>, Eugenio Perez Martin <eperezma@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, Steve Sistare <steven.sistare@oracle.com> Subject: [PATCH V2] vdpa: skip suspend/resume ops if not DRIVER_OK Date: Tue, 13 Feb 2024 06:25:58 -0800 Message-Id: <1707834358-165470-1-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-13_08,2024-02-12_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402130114 X-Proofpoint-ORIG-GUID: ZRIAUdXa9O3X2mLqtThzhFrXMtU4y15M X-Proofpoint-GUID: ZRIAUdXa9O3X2mLqtThzhFrXMtU4y15M Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790794217287617197 X-GMAIL-MSGID: 1790794217287617197 |
Series |
[V2] vdpa: skip suspend/resume ops if not DRIVER_OK
|
|
Commit Message
Steven Sistare
Feb. 13, 2024, 2:25 p.m. UTC
If a vdpa device is not in state DRIVER_OK, then there is no driver state
to preserve, so no need to call the suspend and resume driver ops.
Suggested-by: Eugenio Perez Martin <eperezma@redhat.com>"
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
---
drivers/vhost/vdpa.c | 6 ++++++
1 file changed, 6 insertions(+)
Comments
On Tue, Feb 13, 2024 at 3:26 PM Steve Sistare <steven.sistare@oracle.com> wrote: > > If a vdpa device is not in state DRIVER_OK, then there is no driver state > to preserve, so no need to call the suspend and resume driver ops. > > Suggested-by: Eugenio Perez Martin <eperezma@redhat.com>" > Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Reviewed-by: Eugenio Pérez <eperezma@redhat.com> Please include a changelog from previous versions for the next series. Thanks! > --- > drivers/vhost/vdpa.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > index bc4a51e4638b..aef92a7c57f3 100644 > --- a/drivers/vhost/vdpa.c > +++ b/drivers/vhost/vdpa.c > @@ -595,6 +595,9 @@ static long vhost_vdpa_suspend(struct vhost_vdpa *v) > const struct vdpa_config_ops *ops = vdpa->config; > int ret; > > + if (!(ops->get_status(vdpa) & VIRTIO_CONFIG_S_DRIVER_OK)) > + return 0; > + > if (!ops->suspend) > return -EOPNOTSUPP; > > @@ -615,6 +618,9 @@ static long vhost_vdpa_resume(struct vhost_vdpa *v) > const struct vdpa_config_ops *ops = vdpa->config; > int ret; > > + if (!(ops->get_status(vdpa) & VIRTIO_CONFIG_S_DRIVER_OK)) > + return 0; > + > if (!ops->resume) > return -EOPNOTSUPP; > > -- > 2.39.3 >
On 2/13/2024 9:58 AM, Eugenio Perez Martin wrote: > On Tue, Feb 13, 2024 at 3:26 PM Steve Sistare <steven.sistare@oracle.com> wrote: >> >> If a vdpa device is not in state DRIVER_OK, then there is no driver state >> to preserve, so no need to call the suspend and resume driver ops. >> >> Suggested-by: Eugenio Perez Martin <eperezma@redhat.com>" >> Signed-off-by: Steve Sistare <steven.sistare@oracle.com> > > Reviewed-by: Eugenio Pérez <eperezma@redhat.com> > > Please include a changelog from previous versions for the next series. > > Thanks! Will do, thanks - steve >> --- >> drivers/vhost/vdpa.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c >> index bc4a51e4638b..aef92a7c57f3 100644 >> --- a/drivers/vhost/vdpa.c >> +++ b/drivers/vhost/vdpa.c >> @@ -595,6 +595,9 @@ static long vhost_vdpa_suspend(struct vhost_vdpa *v) >> const struct vdpa_config_ops *ops = vdpa->config; >> int ret; >> >> + if (!(ops->get_status(vdpa) & VIRTIO_CONFIG_S_DRIVER_OK)) >> + return 0; >> + >> if (!ops->suspend) >> return -EOPNOTSUPP; >> >> @@ -615,6 +618,9 @@ static long vhost_vdpa_resume(struct vhost_vdpa *v) >> const struct vdpa_config_ops *ops = vdpa->config; >> int ret; >> >> + if (!(ops->get_status(vdpa) & VIRTIO_CONFIG_S_DRIVER_OK)) >> + return 0; >> + >> if (!ops->resume) >> return -EOPNOTSUPP; >> >> -- >> 2.39.3 >> >
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index bc4a51e4638b..aef92a7c57f3 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -595,6 +595,9 @@ static long vhost_vdpa_suspend(struct vhost_vdpa *v) const struct vdpa_config_ops *ops = vdpa->config; int ret; + if (!(ops->get_status(vdpa) & VIRTIO_CONFIG_S_DRIVER_OK)) + return 0; + if (!ops->suspend) return -EOPNOTSUPP; @@ -615,6 +618,9 @@ static long vhost_vdpa_resume(struct vhost_vdpa *v) const struct vdpa_config_ops *ops = vdpa->config; int ret; + if (!(ops->get_status(vdpa) & VIRTIO_CONFIG_S_DRIVER_OK)) + return 0; + if (!ops->resume) return -EOPNOTSUPP;