Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3199218pxb; Sun, 31 Jan 2021 07:35:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxhuM9I6PTmY2jNs0xLZBORCFlBXdRrgHTs4ciQr74n5d6VQ7du4k4f5LXMfSCfICkP75y X-Received: by 2002:aa7:d692:: with SMTP id d18mr949380edr.327.1612107359226; Sun, 31 Jan 2021 07:35:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612107359; cv=none; d=google.com; s=arc-20160816; b=oj8FHNZ5d/k4nzglzuYQRTht1zXFUzpZJPX2JHAnQClsbnQOpp1T5sx2byeIoVmusi 5TdDjn6mZSV2Ig6eF2KN2UUKEqsYPceJV51pURMZTCGYkxFiI0j5UM5kwV1bvhxLZ7A2 HbHM/bQh1Uq1JQ9MCAYZMXXQsbPdyv70WHNdwnFPkso9kTiKbVClC4WCI7N5sHVZGWP8 cH/VA6RckEfaCDHa8d5a7UE3CygxrXGnHyfUQIPFOyIScTSuIvBZ0YWJwXK2iBKBchQ7 e7nLWgF2OjJpGkKq0WdvAGq6Yn3PZGHiXpXXVG/1tRvu/qDEG9hYRxiXtr5ZI7zlAQLX 3Bdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=/0xd12CGdsGgQtAO4roApjViFTPmfrwbBmD5WIKe4bA=; b=VSNk1TeJxmUztyrMiQEYZJq5pwX5IIENVp8In9SyTfQHEWmDkpcUnaBWXemNVOTx2S tC8YcMfJTrtuHH0f8MVwL3Nn4I/rrn8HHXZicZrzr9Bn7hlHZSaUgZXiFejEwVBUG2t/ cVZPish1V65p8Z5rSg4w3BYoh2I7N7ZaERmUNoU469/dqMkhZilanzkknj8DveJVKWii qSlNOscGB4gOz/6sGfZWJUPbBzUOMJJg54WmJbb2v+wRP6Ww2B3X1tauYSDejlrQHbY2 qogGktnAAXEQWtLFWs6WGduCtcI07mPxdNeEeN2UBRTR0enIBTMToDqSR+IB3MA58rdl bHRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=OSZetRcv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x20si9541139eds.7.2021.01.31.07.35.33; Sun, 31 Jan 2021 07:35:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=OSZetRcv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231920AbhAaPdV (ORCPT + 99 others); Sun, 31 Jan 2021 10:33:21 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:6138 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231680AbhAaPch (ORCPT ); Sun, 31 Jan 2021 10:32:37 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Sun, 31 Jan 2021 07:31:54 -0800 Received: from [172.27.11.151] (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 31 Jan 2021 15:31:52 +0000 Subject: Re: [PATCH RFC v2 08/10] vdpa: add vdpa simulator for block device To: Stefano Garzarella , CC: Xie Yongji , "Michael S. Tsirkin" , Laurent Vivier , Stefan Hajnoczi , , Jason Wang , References: <20210128144127.113245-1-sgarzare@redhat.com> <20210128144127.113245-9-sgarzare@redhat.com> From: Max Gurtovoy Message-ID: Date: Sun, 31 Jan 2021 17:31:43 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210128144127.113245-9-sgarzare@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1612107115; bh=/0xd12CGdsGgQtAO4roApjViFTPmfrwbBmD5WIKe4bA=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding: Content-Language:X-Originating-IP:X-ClientProxiedBy; b=OSZetRcvpEbs0ZZLIMhzYbQI1yiT2a2zmYRRxH0odZjlWuGGNjgmiMoeS7bjQSHox Mlfwj3FAs1mgHvyp+jRnDDxEOsUJd8e1Jljk4CBM6glQChxwB/xewhjDaO5RWLui/e UOymk5H0YZxawSS98flX4W0WdSSYi+96UsQPP9HEUQRMbXETnRBJIZvFICUWZwTImp 9Ae0uZrTi9ByJbkSdW4+DtaM117lgUQq1wY9HOw7EFk3+ECuj4cGU53QIpD1gMZiJL ZalyNj+LmJBBQ30XoiPYCfvHtp5Hq4KNScWQ3PRQnyrlt74yIW6HWMfuCt2eIquWS6 2AohHnABGkoYA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/28/2021 4:41 PM, Stefano Garzarella wrote: > From: Max Gurtovoy > > This will allow running vDPA for virtio block protocol. > > Signed-off-by: Max Gurtovoy > [sgarzare: various cleanups/fixes] > Signed-off-by: Stefano Garzarella > --- > v2: > - rebased on top of other changes (dev_attr, get_config(), notify(), etc.) > - memset to 0 the config structure in vdpasim_blk_get_config() > - used vdpasim pointer in vdpasim_blk_get_config() > > v1: > - Removed unused headers > - Used cpu_to_vdpasim*() to store config fields > - Replaced 'select VDPA_SIM' with 'depends on VDPA_SIM' since selected > option can not depend on other [Jason] > - Start with a single queue for now [Jason] > - Add comments to memory barriers > --- > drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 145 +++++++++++++++++++++++++++ > drivers/vdpa/Kconfig | 7 ++ > drivers/vdpa/vdpa_sim/Makefile | 1 + > 3 files changed, 153 insertions(+) > create mode 100644 drivers/vdpa/vdpa_sim/vdpa_sim_blk.c > > diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c b/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c > new file mode 100644 > index 000000000000..999f9ca0b628 > --- /dev/null > +++ b/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c > @@ -0,0 +1,145 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * VDPA simulator for block device. > + * > + * Copyright (c) 2020, Mellanox Technologies. All rights reserved. I guess we can change the copyright from Mellanox to: Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. Thanks.