From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by dpdk.org (Postfix) with ESMTP id D6CCA9AA2 for ; Thu, 12 Mar 2015 11:18:36 +0100 (CET) Received: by pdbnh10 with SMTP id nh10so19031137pdb.4 for ; Thu, 12 Mar 2015 03:18:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=N7b9QHfqyyG5qyrNhWGzxmpoqrky8Cqw+ljFKW6yjOw=; b=ckbDTMfDAhUm6g9uDNPTi+RwhIn+PREsaliWAwymmdFC48KDbGdCR4jjofScASYV42 s72F0f+WXiokrM0AYRsuSC7/qMhGIhMEYemlMZ9qiSVMHeGJbkwDnWM5a0E9K0cHft4E e3t0ofs3lvuzvmbeJOGfpTVgmsm3ke15iBpOXRQWkX26aH9nXqQJKkkfZFwwl0/cUYFn qtZVc1k41OI7zyXrCdNbfub3mZB0AnUYBzkacOaXfHjgT8H+Pmint0CLGshsyUWCKRJ3 +cEj6dofDd797InzkZYGJtArTuckT09qtUc2oGR3bwGUgMAfVEyWCi8CMpqQ0gPej0sG e6vQ== X-Gm-Message-State: ALoCoQmMkvCdce6NK7nzJa/22/Eg1SzLr1t+g9xKCYRmhPM8NhIYq/VWMBg6nQtcG5giQdez+rbV X-Received: by 10.70.118.197 with SMTP id ko5mr6877195pdb.137.1426155516273; Thu, 12 Mar 2015 03:18:36 -0700 (PDT) Received: from localhost.localdomain (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id z4sm10080331pdi.90.2015.03.12.03.18.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Mar 2015 03:18:35 -0700 (PDT) From: Tetsuya Mukawa To: dev@dpdk.org Date: Thu, 12 Mar 2015 19:17:49 +0900 Message-Id: <1426155474-1596-11-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426155474-1596-1-git-send-email-mukawa@igel.co.jp> References: <1425438703-18895-1-git-send-email-mukawa@igel.co.jp> <1426155474-1596-1-git-send-email-mukawa@igel.co.jp> Subject: [dpdk-dev] [PATCH v2 10/15] eal: Consolidate pci_map and mapped_pci_resource of linuxapp and bsdapp X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 10:18:37 -0000 This patch consolidates below structures, and defines them in common code. - struct pci_map - strucy mapped_pci_resouces Signed-off-by: Tetsuya Mukawa --- lib/librte_eal/bsdapp/eal/eal_pci.c | 24 ------------------------ lib/librte_eal/common/include/rte_pci.h | 28 ++++++++++++++++++++++++++++ lib/librte_eal/linuxapp/eal/eal_pci_init.h | 23 ----------------------- 3 files changed, 28 insertions(+), 47 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index 3e63835..67ad88f 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -82,30 +82,6 @@ * network card, only providing access to PCI BAR to applications, and * enabling bus master. */ - -struct pci_map { - void *addr; - char *path; - uint64_t offset; - uint64_t size; - uint64_t phaddr; -}; - -/* - * For multi-process we need to reproduce all PCI mappings in secondary - * processes, so save them in a tailq. - */ -struct mapped_pci_resource { - TAILQ_ENTRY(mapped_pci_resource) next; - - struct rte_pci_addr pci_addr; - char path[PATH_MAX]; - int nb_maps; - struct pci_map maps[PCI_MAX_RESOURCE]; -}; - -TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource); - static struct rte_tailq_elem rte_uio_tailq = { .name = "UIO_RESOURCE_LIST", }; diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index 995f814..fc64601 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -219,6 +219,34 @@ struct rte_pci_driver { /** Device driver supports detaching capability */ #define RTE_PCI_DRV_DETACHABLE 0x0010 +/** + * A structure describing a PCI mapping. + */ +struct pci_map { + void *addr; + char *path; + uint64_t offset; + uint64_t size; + uint64_t phaddr; +}; + +/** + * A structure describing a mapped PCI resource. + * For multi-process we need to reproduce all PCI mappings in secondary + * processes, so save them in a tailq. + */ +struct mapped_pci_resource { + TAILQ_ENTRY(mapped_pci_resource) next; + + struct rte_pci_addr pci_addr; + char path[PATH_MAX]; + int nb_maps; + struct pci_map maps[PCI_MAX_RESOURCE]; +}; + +/** mapped pci device list */ +TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource); + /**< Internal use only - Macro used by pci addr parsing functions **/ #define GET_PCIADDR_FIELD(in, fd, lim, dlm) \ do { \ diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_init.h b/lib/librte_eal/linuxapp/eal/eal_pci_init.h index aa7b755..d9d1878 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_init.h +++ b/lib/librte_eal/linuxapp/eal/eal_pci_init.h @@ -36,29 +36,6 @@ #include "eal_vfio.h" -struct pci_map { - void *addr; - char *path; - uint64_t offset; - uint64_t size; - uint64_t phaddr; -}; - -/* - * For multi-process we need to reproduce all PCI mappings in secondary - * processes, so save them in a tailq. - */ -struct mapped_pci_resource { - TAILQ_ENTRY(mapped_pci_resource) next; - - struct rte_pci_addr pci_addr; - char path[PATH_MAX]; - int nb_maps; - struct pci_map maps[PCI_MAX_RESOURCE]; -}; - -TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource); - /* * Helper function to map PCI resources right after hugepages in virtual memory */ -- 1.9.1