Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3899529pxb; Tue, 17 Nov 2020 06:30:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3v4yVYToDQo0hwTKg++3SgAfctTimA2pkHXoXlmtAwOVQg5Y9VvgpK/nyoIZpg2asR8RJ X-Received: by 2002:a17:906:c288:: with SMTP id r8mr19175853ejz.35.1605623435613; Tue, 17 Nov 2020 06:30:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605623435; cv=none; d=google.com; s=arc-20160816; b=zNC+LYIkZz7cZ5YtozOqmuUB1LXwdtCwYhTNj4UkPjdZDOl/GTmuVKEMLOk9pP8yuC qM4T9KK1LdF6MZ/vvLOFSUbZVYyUs2IimnXlj9975nTAy+e/G8pn6eleTsA1t//CJ6N6 HPIY8VIKmsTt1FTBAPSdxhtbiHXRwfJi3qONupZVm3q6OROhSjWzk+3bN+13TXzFnnWb +loXSxHQAyS3+1mAipsY7gYVVHOs80U0mW4H1ZuPZ2un1QWjSXYTGe74sBDl6cZ5eXuH NYcrM/SN1OsRl+zVKw9g+Kv2UWU9/ZsajauRjF2JGTBGZIW/bLBAHzzlQNKI8ubkPQnO 7PBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8MXJQ13wlrPLVjvOrheKkQMsdGs3KmerIV6Oa+JEIc8=; b=yZnprm16jtwwdlw1Vb1LjwSydrlL8JjZydGdGu8WNPjygGoXYIf2/dUHppXplQ1Dd/ EztZDWj2vZuEbI4GHO4I6pUyjwmUwPyVKYYF/kUQYHnIIdI8FN3SKI8wzXlGiCVHvBst kid3GnF6mmxk826rhJi+Y+NB6yZ1krjsryyMc2iQeuu07u5GIeil7fW5O8vbytM3coEa ckigWB3sRPwcnLKgeCnG+WEwAsMwZbW7tDnVjCK0wAEimlIExUq54IlwqI67+cLLC+SV jk3Q8vdPT3fyzT+WMDP6/O0OikFhhYsd8afjv+DzaLEohno2BhvQeJ1GpxZTVQk8GMZv j1JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BOzLSVK6; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x64si15063572edc.367.2020.11.17.06.30.09; Tue, 17 Nov 2020 06:30:35 -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=@redhat.com header.s=mimecast20190719 header.b=BOzLSVK6; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728787AbgKQOYk (ORCPT + 99 others); Tue, 17 Nov 2020 09:24:40 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55831 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727952AbgKQOYj (ORCPT ); Tue, 17 Nov 2020 09:24:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605623077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8MXJQ13wlrPLVjvOrheKkQMsdGs3KmerIV6Oa+JEIc8=; b=BOzLSVK6zTWe37V3GWDXi79QW2tJI16eJkTrOjyKZ+5s7exUlcfUG5SAqAWbRYF3jnoPVD TaERZWR/S4/3HZkkEWqqZYzmKJXb07chpcASFgRUDONsphhAEWC0a4SW8LOFDHHgTW5Oda 7Z0o+06jJ9feFpBfGZ1Bwbk8bnhXk2E= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-235-FZtIrzcwOXqEDDY_6SvFEQ-1; Tue, 17 Nov 2020 09:24:35 -0500 X-MC-Unique: FZtIrzcwOXqEDDY_6SvFEQ-1 Received: by mail-wr1-f72.google.com with SMTP id k1so12983313wrg.12 for ; Tue, 17 Nov 2020 06:24:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=8MXJQ13wlrPLVjvOrheKkQMsdGs3KmerIV6Oa+JEIc8=; b=STxGxe99HvFNri0We+WTr1ehNJQQLrL9jwCaUjPlaTxR7Jt4cjqQS7m2L78gqe5A1q pPl6fFgDpKL/oq6nz3/gRr22pZbqPVEdlBi9nMnzF+UCWlhFGGNB3veRnTIZYGvSPSQh iev1qF55MO2CG42hUg/J+qAOcXpKJrJGATep04hPV5j+uMFuO1Bf/mQI8Od8uxcv7zX9 IiE96Tm6k9306VXVWyTa6OrusuNERjdvctUaGweC6kqNWm7sVo5pnWL/irBxceUZy/7t tB1GwbuwB/Nnrlh6zhLhrHlcAJryY38P3DpnPWWm3qttUX9fmLeZRbkLka14I58PBSbW hEVw== X-Gm-Message-State: AOAM530LeOJdvNem1PzxitytnUOXqkKt+oRGwktBDAD9DrGHzaWcCZwt QX4HkK1GLfKCHQnBG1nucI9CnXW5PSae9YE4pfymZp/rTGMP8i+IyaB5mRItQFuklvHx8oYJwsd 2z87NjdZZEvexzReCupt/WLt1 X-Received: by 2002:a7b:c5c6:: with SMTP id n6mr4871105wmk.131.1605623074685; Tue, 17 Nov 2020 06:24:34 -0800 (PST) X-Received: by 2002:a7b:c5c6:: with SMTP id n6mr4871085wmk.131.1605623074442; Tue, 17 Nov 2020 06:24:34 -0800 (PST) Received: from steredhat (host-79-17-248-175.retail.telecomitalia.it. [79.17.248.175]) by smtp.gmail.com with ESMTPSA id 109sm28800836wra.29.2020.11.17.06.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 06:24:33 -0800 (PST) Date: Tue, 17 Nov 2020 15:24:30 +0100 From: Stefano Garzarella To: Stefan Hajnoczi Cc: virtualization@lists.linux-foundation.org, Laurent Vivier , linux-kernel@vger.kernel.org, Eli Cohen , Jason Wang , "Michael S. Tsirkin" , Max Gurtovoy Subject: Re: [PATCH RFC 06/12] vdpa_sim: add struct vdpasim_device to store device properties Message-ID: <20201117142430.qqlh5d5d6smbfxur@steredhat> References: <20201113134712.69744-1-sgarzare@redhat.com> <20201113134712.69744-7-sgarzare@redhat.com> <20201117112305.GE131917@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20201117112305.GE131917@stefanha-x1.localdomain> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17, 2020 at 11:23:05AM +0000, Stefan Hajnoczi wrote: >On Fri, Nov 13, 2020 at 02:47:06PM +0100, Stefano Garzarella wrote: >> Move device properties used during the entire life cycle in a new >> structure to simplify the copy of these fields during the vdpasim >> initialization. >> >> Signed-off-by: Stefano Garzarella >> --- >> drivers/vdpa/vdpa_sim/vdpa_sim.h | 17 ++++++++------ >> drivers/vdpa/vdpa_sim/vdpa_sim.c | 33 ++++++++++++++-------------- >> drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 8 +++++-- >> drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 9 +++++--- >> 4 files changed, 38 insertions(+), 29 deletions(-) >> >> diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.h b/drivers/vdpa/vdpa_sim/vdpa_sim.h >> index 6a1267c40d5e..76e642042eb0 100644 >> --- a/drivers/vdpa/vdpa_sim/vdpa_sim.h >> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.h >> @@ -40,12 +40,17 @@ struct vdpasim_virtqueue { >> irqreturn_t (*cb)(void *data); >> }; >> >> +struct vdpasim_device { >> + u64 supported_features; >> + u32 id; >> + int nvqs; >> +}; >> + >> struct vdpasim_init_attr { >> - u32 device_id; >> - u64 features; >> + struct vdpasim_device device; > >It's unclear to me what the exact purpose of struct vdpasim_device is. >At least the name reminds me of struct device, which this is not. > >Should this be called just struct vdpasim_attr or struct >vdpasim_dev_attr? In other words, the attributes that are needed even >after intialization? Yes, they are attributes that are needed even after intialization, so I think vdpasim_dev_attr should be better. I'll change it and I'll try to write a better commit message. Thanks, Stefano