From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B9279A0A02; Thu, 14 Jan 2021 15:44:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8BE311412E8; Thu, 14 Jan 2021 15:44:40 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id D238E1412E7 for ; Thu, 14 Jan 2021 15:44:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610635479; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Drs0pY+NwKdXfwcidRXFPFFU77ESm4NMgwgKBIlApYU=; b=dMrpdh6AThALMTcf2LUozaAnFHixu8fI041OeD9YeMPsh0PIT00jI3xUK6jEupq5Vvsu/z gpH/tY/9OH3+76xf3k3dRpiKUpw2l/M7oUEsVjRVnhB17g3oOLnwzo3nZFi9EeSNoogoRm 3+WmmMX1Hq2GZ5tWVGJmCkfIxQN9MT0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-202-TDn2W1zlOu2iMtx8QZPi2w-1; Thu, 14 Jan 2021 09:44:37 -0500 X-MC-Unique: TDn2W1zlOu2iMtx8QZPi2w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 445D78030A0; Thu, 14 Jan 2021 14:44:36 +0000 (UTC) Received: from [10.36.110.24] (unknown [10.36.110.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C127760C6B; Thu, 14 Jan 2021 14:44:31 +0000 (UTC) To: David Marchand Cc: dev , "Xia, Chenbo" , Olivier Matz , Adrian Moreno Zapata References: <20201220211405.313012-1-maxime.coquelin@redhat.com> <20201220211405.313012-5-maxime.coquelin@redhat.com> <7a809069-16a3-9c48-0d09-3ba4c8227f48@redhat.com> From: Maxime Coquelin Message-ID: <6598fcf3-ef21-5b79-4833-3da08d6b90f2@redhat.com> Date: Thu, 14 Jan 2021 15:44:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 04/40] net/virtio: introduce PCI device metadata X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 1/14/21 3:40 PM, David Marchand wrote: > On Thu, Jan 14, 2021 at 12:05 PM Maxime Coquelin > wrote: >> On 1/5/21 10:16 PM, David Marchand wrote: >>> On Sun, Dec 20, 2020 at 10:14 PM Maxime Coquelin >>> wrote: >>>> >>>> This patch initiate refactoring of Virtio PCI, by introducing >>>> a new device structure for PCI-specific metadata. >>> >>> This works, but this patch seems artificial. >>> >>> The eth_virtio_dev_init expects dev->data->dev_private to be a virtio_hw object. >>> You can introduce this later in the series when really needed. >>> >>> >> I propose to squash it into patch 5, which moves PCI specific init to a >> dedicated file. >> >> Is that OK for you? > > Or leave this commit like this but add a check on the virtio_hw field > being the first field of the bus specific objects. > Something like: > RTE_BUILD_BUG_ON(offsetof(struct virtio_pci_dev, hw) != 0); > > + the same with virtio_user in the relevant patch. > I like the idea, will be done in v2. Thanks for the suggestion, Maxime