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 78D9DA0A0E; Wed, 3 Feb 2021 18:19:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0972F240681; Wed, 3 Feb 2021 18:19:27 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 4C740240669 for ; Wed, 3 Feb 2021 18:19:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612372764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3Tdhdej1+RX/VHltzdyGaF7+IL9RQ6dQhWR7UdI4nJ4=; b=EeBdkT2RsK9r30ujhfgAzSlWH4NywKev8WHunZ2ppUwHkfG6DH22QEib+qrS7kkHgqK7jM 8opLPagBkHIUMNBGy8wy7TBTacqQqtK5LFVlVtKtGRUiFQgjyYS2/2aQJlpr0EEwsF241b +FP6hz7cGYE4HWNAWeWbTYlmc19A/AI= 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-407-yXOBVkDePf-5eVBUEC6PFw-1; Wed, 03 Feb 2021 12:19:22 -0500 X-MC-Unique: yXOBVkDePf-5eVBUEC6PFw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2DB628030B4; Wed, 3 Feb 2021 17:19:21 +0000 (UTC) Received: from [10.36.110.4] (unknown [10.36.110.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7DE3E5B692; Wed, 3 Feb 2021 17:19:16 +0000 (UTC) To: dev@dpdk.org, yinan.wang@intel.com, chenbo.xia@intel.com, amorenoz@redhat.com, david.marchand@redhat.com, weix.ling@intel.com, yux.jiang@intel.com, anatoly.burakov@intel.com References: <20210203155811.53005-1-maxime.coquelin@redhat.com> From: Maxime Coquelin Message-ID: <7f595b3f-66fb-6820-c168-e3ffa441bf93@redhat.com> Date: Wed, 3 Feb 2021 18:19:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210203155811.53005-1-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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] net/virtio: fix secondary process crash with PCI devices 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 2/3/21 4:58 PM, Maxime Coquelin wrote: > The Virtio rework series mistakenly moved the rte_pci_device > pointer to struct virtio_hw, which is shared between the two > processes. But this structure is per-process, so this change > made secondary process to try accessing primary process-only > memory, leading to a crash > > This patch reverts to proper behavior, by storing the > rte_pci_device pointer into the pre-process > virtio_pci_internal struct. It provides also helper to get > the pointer from the virtio_hw struct pointer. > > Bugzilla ID: 633 > Fixes: c8d4b02f72ae ("net/virtio: move legacy IO to virtio PCI") > > Reported-by: Anatoly Burakov > Signed-off-by: Maxime Coquelin > --- > drivers/net/virtio/virtio_pci.c | 25 +++++-------------------- > drivers/net/virtio/virtio_pci.h | 12 +++++++++++- > drivers/net/virtio/virtio_pci_ethdev.c | 2 ++ > 3 files changed, 18 insertions(+), 21 deletions(-) > Applied to dpdk-next-virtio/main with typo fixed. Thanks, Maxime