From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f43.google.com (mail-oi0-f43.google.com [209.85.218.43]) by dpdk.org (Postfix) with ESMTP id CE32E5A29 for ; Tue, 7 Jul 2015 10:05:20 +0200 (CEST) Received: by oiaf66 with SMTP id f66so104125373oia.3 for ; Tue, 07 Jul 2015 01:05:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ROCw5Tlg3Fiorvd9MvAWiX+efSXDfAkFlHLgDxNqf+Y=; b=Glo/7aMD5tlfCbJS05a/eL96SGkJNzp/rnBlTJFCr5QzIjy++oTIT3Li/dxKC3c6Cf OyoafaDks0JBF9LXpcNwXVP2xfkYI2eoI49v7JhkBB37LuOurV1MNlkpq70ldK64pnLk Z1PnLjj8d1AQYXg3iDOOaydAR8WT+NZ/YujbK9+GCQpBfQogHO84aVXs2IMSLT3PyWYC 7rvC01vD9kILis80w7Faq+FAqrjyf4xCa8LudW+tFPIsbPyDIMV3U+UDfhahF/AJRrPX 6xIdZpkqBRdLRZnPoBXwJazb41KSh6wwPeLeeb56Tw2goSmulJwUFQEF245yzgERMPuD do9A== X-Gm-Message-State: ALoCoQngUm1wvf0yXMbkhMm51JqXSx+hu7ptVRrtyQPHtd2rHflFWFbCtYqq/x76JrCd7QDsUmbb MIME-Version: 1.0 X-Received: by 10.202.216.135 with SMTP id p129mr2577396oig.90.1436256320317; Tue, 07 Jul 2015 01:05:20 -0700 (PDT) Received: by 10.76.84.233 with HTTP; Tue, 7 Jul 2015 01:05:20 -0700 (PDT) In-Reply-To: <1436163861-3025-9-git-send-email-mukawa@igel.co.jp> References: <1435652668-3380-12-git-send-email-mukawa@igel.co.jp> <1436163861-3025-1-git-send-email-mukawa@igel.co.jp> <1436163861-3025-9-git-send-email-mukawa@igel.co.jp> Date: Tue, 7 Jul 2015 10:05:20 +0200 Message-ID: From: David Marchand To: Tetsuya Mukawa Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v8 08/12] 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: Tue, 07 Jul 2015 08:05:21 -0000 On Mon, Jul 6, 2015 at 8:24 AM, Tetsuya Mukawa wrote: > From: "Tetsuya.Mukawa" > > 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 | 29 > +++++++++++++++++++++++++++++ > lib/librte_eal/linuxapp/eal/eal_pci_init.h | 23 ----------------------- > 3 files changed, 29 insertions(+), 47 deletions(-) > > diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c > b/lib/librte_eal/bsdapp/eal/eal_pci.c > index c76f936..6067e31 100644 > --- a/lib/librte_eal/bsdapp/eal/eal_pci.c > +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c > @@ -83,30 +83,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 7801fa0..d95747e 100644 > --- a/lib/librte_eal/common/include/rte_pci.h > +++ b/lib/librte_eal/common/include/rte_pci.h > @@ -2,6 +2,7 @@ > * BSD LICENSE > * > * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. > + * Copyright(c) 2015 IGEL Co., Ltd. > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -220,6 +221,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 > */ > -- > 2.1.4 > > Acked-by: David Marchand -- David Marchand