From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (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 AB17A18CC15; Tue, 7 Jan 2025 13:14:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736255694; cv=none; b=LgcFXKP2H7JmqLyExhNtJ+H03io9ZhQOTM7UP+0D8j9rsfzZLVev2HwoDC0WEhmwi9PBIeHSaZ6GjiBQmkH7ojsTv14xHJ2+wCnbpReZPKMOmzZI6zUdVAJpEXP7h9LH72NBMeSzbtDt5rlykZI/lWdhXs0OCFVP6o13D2XsSKI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736255694; c=relaxed/simple; bh=uGvtVmh1VBQMZDbhKtaXTTM8an8VdHRzDmLgsyfenps=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=AgNfKLcp8ZeRgu6SWaXZ0rcKa/BNcvKM53mel5jXzmCyrLM3CJgbSSjAEjOi6+skI1qcViwureJ+VGdKNAyqSB7bzv3np1JeDpMEopAmFlxRbvq8yAV7tEhd0snyo8EH830J5iGP3WA3+5wcSaigR6x9QFGBe0OZ4lnzUo1nl44= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4YSBLS0PWnzpZJM; Tue, 7 Jan 2025 21:13:04 +0800 (CST) Received: from kwepemd500012.china.huawei.com (unknown [7.221.188.25]) by mail.maildlp.com (Postfix) with ESMTPS id BDE54180087; Tue, 7 Jan 2025 21:14:45 +0800 (CST) Received: from kwepemd500012.china.huawei.com (7.221.188.25) by kwepemd500012.china.huawei.com (7.221.188.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Tue, 7 Jan 2025 21:14:45 +0800 Received: from kwepemd500012.china.huawei.com ([7.221.188.25]) by kwepemd500012.china.huawei.com ([7.221.188.25]) with mapi id 15.02.1258.034; Tue, 7 Jan 2025 21:14:45 +0800 From: lizetao To: Ferry Meng , "Michael S . Tsirkin" , Jason Wang , "linux-block@vger.kernel.org" , Jens Axboe , "virtualization@lists.linux.dev" CC: "linux-kernel@vger.kernel.org" , "io-uring@vger.kernel.org" , Stefan Hajnoczi , Christoph Hellwig , Joseph Qi , Jeffle Xu Subject: RE: [PATCH v1 2/3] virtio-blk: add uring_cmd support for I/O passthru on chardev. Thread-Topic: [PATCH v1 2/3] virtio-blk: add uring_cmd support for I/O passthru on chardev. Thread-Index: AQHbUS+9ylKmIhB65Ui5jP/WaqakW7MLaSyw Date: Tue, 7 Jan 2025 13:14:45 +0000 Message-ID: References: <20241218092435.21671-1-mengferry@linux.alibaba.com> <20241218092435.21671-3-mengferry@linux.alibaba.com> In-Reply-To: <20241218092435.21671-3-mengferry@linux.alibaba.com> Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SGksDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogRmVycnkgTWVuZyA8 bWVuZ2ZlcnJ5QGx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