From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 72EA52BAE for ; Fri, 7 Apr 2017 10:14:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491552883; x=1523088883; h=from:to:cc:subject:date:message-id; bh=Ze+oOIDRGKLFLqvEQHev7Qg3ZBf66KaiZ1nmTTKuFy8=; b=vfYW/IXxEdR5KBae/H9Xqjd3/u6tzK6ofQDdaoZZUccAWSoUu4D5sOzp hHkMW7ZqTK/uBsoXigMVnaBVVoBOGA==; Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Apr 2017 01:14:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,164,1488873600"; d="scan'208";a="953273211" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by orsmga003.jf.intel.com with ESMTP; 07 Apr 2017 01:14:39 -0700 From: Yuanhan Liu To: Ben Walker Cc: Yuanhan Liu , Shreyansh Jain , dpdk stable Date: Fri, 7 Apr 2017 16:11:18 +0800 Message-Id: <1491552724-3034-1-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 Subject: [dpdk-stable] patch 'pci: fix device registration on FreeBSD' has been queued to LTS release 16.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Apr 2017 08:14:43 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/11/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 73b3b85757b28d53d328fb174d4b14ee8478efbf Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 21 Mar 2017 11:32:15 -0700 Subject: [PATCH] pci: fix device registration on FreeBSD [ upstream commit 24a535796824049fab8570d0b29e658470375876 ] The FreeBSD implementation wasn't registering new devices with the device framework on start up. However, common code attempts to unregister them on shutdown which causes a SEGFAULT. This fix makes the FreeBSD code do the same thing as the Linux code for registration. Fixes: 13a1317d3ba7 ("pci: create device list and fallback on its members") Signed-off-by: Ben Walker Acked-by: Shreyansh Jain --- lib/librte_eal/bsdapp/eal/eal_pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index 8b3ed88..f1de16e 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -323,6 +323,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) /* device is valid, add in list (sorted) */ if (TAILQ_EMPTY(&pci_device_list)) { + rte_eal_device_insert(&dev->device); TAILQ_INSERT_TAIL(&pci_device_list, dev, next); } else { @@ -335,7 +336,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) continue; else if (ret < 0) { TAILQ_INSERT_BEFORE(dev2, dev, next); - return 0; + rte_eal_device_insert(&dev->device); } else { /* already registered */ dev2->kdrv = dev->kdrv; dev2->max_vfs = dev->max_vfs; @@ -343,9 +344,10 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) dev->mem_resource, sizeof(dev->mem_resource)); free(dev); - return 0; } + return 0; } + rte_eal_device_insert(&dev->device); TAILQ_INSERT_TAIL(&pci_device_list, dev, next); } -- 1.9.0