From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 9B4B62904 for ; Wed, 26 Apr 2017 03:29:50 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2017 18:29:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,252,1488873600"; d="scan'208";a="1140179794" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga001.fm.intel.com with ESMTP; 25 Apr 2017 18:29:48 -0700 Date: Wed, 26 Apr 2017 09:26:24 +0800 From: Yuanhan Liu To: Jianfeng Tan , Thomas Monjalon Cc: dev@dpdk.org Message-ID: <20170426012624.GE11512@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 Content-Disposition: inline In-Reply-To: <1492741689-40422-1-git-send-email-jianfeng.tan@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] net/virtio-user: fix recognize physical devices X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Apr 2017 01:29:51 -0000 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 Acked-by: Yuanhan Liu --yliu