Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp105129rdh; Tue, 6 Feb 2024 21:47:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcrRQ3tfZgXW9It3vp9dbvEcwIe7kd384bM8kc829U19LUkVWw8zeT1i+1lG4zWtrl1kSW X-Received: by 2002:a17:907:1007:b0:a38:833b:c8ad with SMTP id ox7-20020a170907100700b00a38833bc8admr273776ejb.16.1707284868077; Tue, 06 Feb 2024 21:47:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707284868; cv=pass; d=google.com; s=arc-20160816; b=DBOdlQLw3go6fNP19QBLW2cAPakSPCGYIcBMuQVCcWKIOdCfP+N3eew//k8jr8e50J PmHwCoXSDLjVbAas5vi4O/DGlgduj70+Q+vvd9YCSMggKRCtPQL6Xn+Zfm1eOPaLH4cX /e1lrX5IP3T5/WmUilatQW5Mctk1mnQCrpqLjon0zh3tY3ySFynwrt64RYxqf3OMDb6O PQJG4QZmlIYOOoTF/tgJJ5C9NwOsGcLCRhOszag/o19dKjaCCu67NIqGXc9DSf4MFKkR 6rwsHkEUt0GbWr3MMOB5NvOyW/7H18oc+2Vi8yLRgXXtGSlecVuSSV1V8R2LQ0x1zpvO b56g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=hwsrIyNME3xvIfwfaV6NG7sB+rLE21QzcYEDoBZyr4Q=; fh=swcVmCNLIw1q0Ly3MspqY/eVvoOQ5EGZKvyTdUNsdLI=; b=fh4KYxejGKamO66Qzr5YB00AESpTAh11CUDXJkH11DyxDR6W2U8w6lU4zv60Gcc1pX hTTcdmsVNf/DuDCbKgZIj658y5LFfW2HH90dEuUXJ5gsUkH3Zb200JQfvvRldFhepF7Y fN8tSIEACUOA+t8qG26I0jwfAyB8V050+KZyiq1OBp9zy4Orw8Hk+2kVKmD2JTJTCtwR wbqKrCjjQcUqFI+V2CoiwkA7etLaKB2qJyE+tSUGIK7Z4uPTbypZx99Grt75XoYh6aCs C67SnVkQHZjT/kgxEUcL4jlTCmeKE884aL8UHEVGcif8JZrirRrloAaIc5qflQ73EL4r tMxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JwnglLS9; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-55982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCXxgRKTLBDZ+jYEouGDPzhfDOpZ0FbDdK5Q+EvbDg/+YgCvkTEWaquqjvhmF3qxDq5jqwhDjxOtQsHdNLVBdUPR5eNHMiV43KhdVK8IPw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a16-20020a17090640d000b00a383403fbf1si465875ejk.644.2024.02.06.21.47.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 21:47:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55982-linux.lists.archive=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=@redhat.com header.s=mimecast20190719 header.b=JwnglLS9; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-55982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 CFC311F23372 for ; Wed, 7 Feb 2024 05:47:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16AC61D546; Wed, 7 Feb 2024 05:47:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JwnglLS9" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 901161CF92 for ; Wed, 7 Feb 2024 05:47:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707284839; cv=none; b=YfCrnWoTkehzVx2y9ofxreLEDWQR0RYM0Mw20LzQt3FZ+bQNzfQ9LyGcfOFrAeMi+e/pvCzV+9EvptM9/kX0xVpuFIOPEB0baBnZC+2WfUNODijuCEiudQPFRluYFt1+phQzyrCor19uBIz9+NNZeG4Nt4ceJoZHomNdvOx6QUo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707284839; c=relaxed/simple; bh=j1lCtWf8kQGK0h6m9q3I3l1BoBQdXKPTjFjyW0xeUpg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LwT54F+B9ff/4roH/Dlu8JJZhQefMCnhz8WmYAO06Se9ZjoWC8L73e3YcBY6OjzC83meGU0u6JHdBFwvUL4V0Saz/ZvIO4lVe+YtKS+FCpoAqpuW+2LohCquh+Vfp4LAlfha5aH2YaX/OENDy8q7/PLSPc8n/SpU/FuhxiRm86k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=JwnglLS9; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707284836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hwsrIyNME3xvIfwfaV6NG7sB+rLE21QzcYEDoBZyr4Q=; b=JwnglLS9NH/V7kX7W39P1A4wZ2sisDAKL0Bw4qQR32eMDaRQOeBxsYwcvxQgirV7kUzmr2 6EzR0zeV5eI0lsv63/JWiyOvkAcQV8Kmsxi1qPZSHTzRia08eOVvRTXZpciJZ7s+MQxz+r QkfiINwneTYC0O1O07RT4zu7vnu1xKQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-121-DczEB4sWPJKuz0ywDfuvYg-1; Wed, 07 Feb 2024 00:47:14 -0500 X-MC-Unique: DczEB4sWPJKuz0ywDfuvYg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8902483722F; Wed, 7 Feb 2024 05:47:14 +0000 (UTC) Received: from server.redhat.com (unknown [10.72.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08522C1D36C; Wed, 7 Feb 2024 05:47:11 +0000 (UTC) From: Cindy Lu To: lulu@redhat.com, jasowang@redhat.com, mst@redhat.com, xieyongji@bytedance.com, linux-kernel@vger.kernel.org, maxime.coquelin@redhat.com Subject: [PATCH v4 2/5] vduse: Add new ioctl VDUSE_DEV_GET_STATUS Date: Wed, 7 Feb 2024 13:43:29 +0800 Message-ID: <20240207054701.616094-3-lulu@redhat.com> In-Reply-To: <20240207054701.616094-1-lulu@redhat.com> References: <20240207054701.616094-1-lulu@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 The ioctl VDUSE_DEV_GET_STATUS is used by the Userspace App to get the device status Signed-off-by: Cindy Lu --- drivers/vdpa/vdpa_user/vduse_dev.c | 7 +++++++ include/uapi/linux/vduse.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c index ab246da27616..ef3c9681941e 100644 --- a/drivers/vdpa/vdpa_user/vduse_dev.c +++ b/drivers/vdpa/vdpa_user/vduse_dev.c @@ -1389,6 +1389,13 @@ static long vduse_dev_ioctl(struct file *file, unsigned int cmd, ret = 0; break; } + + case VDUSE_DEV_GET_STATUS: + /* + * Returns the status read from device + */ + ret = put_user(dev->status, (u8 __user *)argp); + break; default: ret = -ENOIOCTLCMD; break; diff --git a/include/uapi/linux/vduse.h b/include/uapi/linux/vduse.h index 125d7529d91b..f501173a9d69 100644 --- a/include/uapi/linux/vduse.h +++ b/include/uapi/linux/vduse.h @@ -353,4 +353,6 @@ struct vduse_dev_response { /* get device configuration space */ #define VDUSE_DEV_GET_CONFIG _IOR(VDUSE_BASE, 0x1b, struct vduse_config_data) +#define VDUSE_DEV_GET_STATUS _IOR(VDUSE_BASE, 0x1c, __u8) + #endif /* _UAPI_VDUSE_H_ */ -- 2.43.0