From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH] net/virtio-user: fix recognize physical devices Date: Fri, 28 Apr 2017 12:49:42 +0800 Message-ID: <20170428044942.GQ11512@yliu-dev.sh.intel.com> References: <1492741689-40422-1-git-send-email-jianfeng.tan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Jianfeng Tan Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 4DF6E9E3 for ; Fri, 28 Apr 2017 06:53:11 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1492741689-40422-1-git-send-email-jianfeng.tan@intel.com> 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 Fri, Apr 21, 2017 at 02:28:09AM +0000, Jianfeng Tan wrote: > Segfault happens when using virtio-user after commit 7f0a669e7b04 > ("ethdev: add allocation helper for virtual drivers"). > > It's due to we use ethdev->device to recognize physical devices, > but after above commit, this field is also filled for virtual > devices. Then we obtain the wrong pci_dev pointer and accessing > its field when copying pci info results in segfault. > > To fix it, we use hw->virtio_user_dev to differentiate physical > devices from virtual devices. > > Fixes: 6a7c0dfcdf40 ("net/virtio: do not depend on PCI device of ethdev") > > Signed-off-by: Jianfeng Tan Applied to dpdk-next-virtio. Thanks. --yliu