From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 27 Apr 2017 21:53:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,387,1488873600"; d="scan'208";a="79912722" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2017 21:53:08 -0700 Date: Fri, 28 Apr 2017 12:49:42 +0800 From: Yuanhan Liu To: Jianfeng Tan Cc: dev@dpdk.org 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 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: Fri, 28 Apr 2017 04:53:11 -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 Applied to dpdk-next-virtio. Thanks. --yliu