From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0082.outbound.protection.outlook.com [104.47.42.82]) by dpdk.org (Postfix) with ESMTP id A25EE5A6C for ; Fri, 26 Aug 2016 15:58:23 +0200 (CEST) Received: from BN6PR03CA0048.namprd03.prod.outlook.com (10.175.124.34) by DM2PR0301MB0717.namprd03.prod.outlook.com (10.160.97.13) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21; Fri, 26 Aug 2016 13:58:21 +0000 Received: from BN1AFFO11FD015.protection.gbl (2a01:111:f400:7c10::191) by BN6PR03CA0048.outlook.office365.com (2603:10b6:404:10c::34) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.9 via Frontend Transport; Fri, 26 Aug 2016 13:58:20 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD015.mail.protection.outlook.com (10.58.52.75) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Fri, 26 Aug 2016 13:58:21 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u7QDvHpw023630; Fri, 26 Aug 2016 06:58:18 -0700 From: Shreyansh Jain To: CC: , , , , Shreyansh Jain Date: Fri, 26 Aug 2016 19:26:59 +0530 Message-ID: <1472219823-29486-22-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472219823-29486-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1472219823-29486-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131166935014073360; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(8676002)(2351001)(77096005)(19580405001)(586003)(81156014)(36756003)(33646002)(92566002)(81166006)(8936002)(19580395003)(575784001)(105606002)(86362001)(85426001)(50466002)(5660300001)(106466001)(47776003)(76176999)(229853001)(48376002)(189998001)(87936001)(50226002)(68736007)(4326007)(110136002)(104016004)(5003940100001)(2950100001)(50986999)(2906002)(7846002)(97736004)(626004)(305945005)(356003)(8666005)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0717; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD015; 1:MwYQx87axmeyfY8mXPhPWtUiLtXLONHMpSYRByA9k1jgds7DaKvvmA/iKQkdeyorMvluKIc+dRgbikaxXPAEMQ3lTsC0kq9Ap6VfMEr/5Tz/YAjbt9D/U3l3VyQIKq+3vxqt2IHaBCZRId4zAx5H/ikmQ2sTCDLQ1ZcBDTQ1qwbgEGtuyo+FsWXeT6IQn11CdX/fRdAhJ+2xDKw8IznEzH+c+p3+mnEARufIjzQ6M6Sxk3+uIYX831eM0u62JrUAXYwICQUkv/Zy46Z3Ry3ocEW/yX0K0OiSrrGcp8x9UoafxWNYhXGvWDIh+6h2uEsHtmMAfKrsR3ga38CFb1SzCXD4AJF049D0VN8+2VjBKu4aU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BYTZNCkk1FRDwlOIWjiIw2jdAlRkNnnhVS3t1631NBwFme8ip4F7b6nKetvNnuMXtmxJjGMaVNVPdtaO7V7xH32VJVPD6Gbw+Uy8sur8u7tzv6M= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13024025)(13015025)(13018025)(13023025)(13017025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:DM2PR0301MB0717; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0717; X-Forefront-PRVS: 00462943DE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0717; 23:QWUJqGSZtlOe37Lrz8wJ+h/MJsdTmYNf3d4EFfq?= =?us-ascii?Q?uA0LqeAP++J5kd+kFCd1yDSOw3NpV6bR/sZyEV+Ici16xOfjtr7Az5/Uhpyb?= =?us-ascii?Q?Q+H3DPM7BezLTcdvrObqAmv7/So7dussgAo68VgxqoaKFJL9EY1HC2wkg+Da?= =?us-ascii?Q?u2DnvFEke6U+1jXAKCdAVXiQyyDsicKOHszpnPt1uRvq0zdDYbmidvYqvK90?= =?us-ascii?Q?2ycTwsJITucXl1N8ncT6lY0qDPBf3GHxUjISwf19QglxcNlzYxM3F8SNwqtx?= =?us-ascii?Q?rxMOkvZsGxy6xViAO4kf3lA2DLmxymRWo1ptIKV5nT63J3VLNVkuWAkQyWj+?= =?us-ascii?Q?AgIk31ZvlKPJYCUnuzSvriJRO5RQdZEyZ960vXxGdry5GcVhRqFMt7pFzZpG?= =?us-ascii?Q?PHTSEBZK1p6Ou4cEeOJk/6o1J+ULHcs2WxZJLvMz5StRZQTTkguHHF9V25MQ?= =?us-ascii?Q?GOcevurM6g6ZmM8XpNL+TWilQPR3OBnXt9+BYoQSApm0LKae5ispOYmkjNY8?= =?us-ascii?Q?2WTgYPs5GB+zSVEODzGRLRE+UcSJNYohWNoGI2EzK/qgw1auzTst9OoNbn3X?= =?us-ascii?Q?XzUH9708RZ0Ga1He2L+XSnqEXoQAY33g/F2mySys593L7E7FOmChJiW/xaWQ?= =?us-ascii?Q?uHbh6Sc+M3wT8AqBvmGkOrI/V0/W2XJMgxUtgIvkODq1TbYB0y+ZdIlfutEe?= =?us-ascii?Q?FCfMCFp5Jp0ktzhibWGkGZ1PMkKgXFc0q0qGAlcsNC030HsJdLfIOU/eyq4r?= =?us-ascii?Q?/KVqHUmf+U+gHlz8ONVn93RQ+ZhPt+UbZ8LHCmC79l/iH38G2GV37lr8VpFO?= =?us-ascii?Q?2xaoolXk09m0fdu4TGplKksmWVqm0SinmQ5UEiNmDojIQQCTeqXX0raLPpiq?= =?us-ascii?Q?DwTI/p083sccBfFNwhbaDYvnNphVewRJmVl2Fcr1cCwg3pD3ZovV2mKlYZWQ?= =?us-ascii?Q?jmnxDCXfiw2LSw+2hz0ow9vFfmI+mfmSwzN1aBFaMh778ktpK+FsTgOoBqLs?= =?us-ascii?Q?sC4WThLN3838U3XlDniTBwY5ZLGQhoI5dXl0jRyapMNFZa89OGcycU9u56p9?= =?us-ascii?Q?KaUqTto6BEyxzGeBAIpRiGEd7d0edtwxboehCHXoV7FzZhNG/U06nuVpV1wm?= =?us-ascii?Q?e1Ibc4VxdjjfRz4nPB9KWeZK4Z/UUgat7gQyc78QiOFUIPkpg23n1bg=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0717; 6:T8Hb7qS8ZZRwlO38budq47S0N9wWDhs3A/NT+2Xy1JhCHbVcGwOh7o5I/yafgcBdIsiCqsBAmur2cgJe4gHNbkZyq8eEDusF4fs+xkbwARWvxYuGS3kAXUoMHZaD42npKgpfnHHn/iyKgKQqsNKJwu13RZRmgzWuMmUBHirk0h41wFYDnHVygOKx23DGiiw3xNwvuLZh6k9gSSjkP1raBOLQfcp/D29J8ATjBSE3UgMin6tkUVdnICo0+zGkHozOUYMYF+pnE2VlnZk3Avjc7G0ZOxFzVF7j6jL6EHlNdyM=; 5:oQQ4zDXafyrc0wf+EsVy1LetsMoHKbnZyuj3Xu1Xemy5gvWezL0YyzV7XIe9dIAcTtIlIgPBWA1IxZlnEQcAuYm6gosFD/2+hcfMKLmCa9vBEuNaSrMXqcWPOjaJEerT7kbslZZzPG4OD0rY/KArVZR5v2oWiXhSl9avCJsOWqY=; 24:8I+4J9v5Zua8mGtckbwZ2P26bcu9lVq1UwryQroqob0HpF0U3Yc3On7g1JzGQSf6nQh6BuwoqazmdTOGmp9YCcqBF9pxAKlDumlyvW9QY2Q=; 7:faQmDxSYCem/L4gj2ykxc5DF3JalmZyFJZ9YEZa0AIlaEH2WkbDYgdUrsZ4TDL/QcM2VMpx7EXshejrQALZTxS3Zs5dX5xExJ+390yf2t0cAPuFLxMIwE7oXuHwj/V1MB+zHz3bYF9KwGekyRQ50S9pasEKQJQ6gm+U349RX2wc1DCbGNC6VY+xAbitHN8IwFBf6xrzheo+RUJTL74rsCkT3WF8VHUkfQ7ddT6+3ZW40XkqIUJdqZR8dI0avCrrd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 13:58:21.2045 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0717 Subject: [dpdk-dev] [PATCH v8 21/25] eal: rename and move rte_pci_resource 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: Fri, 26 Aug 2016 13:58:24 -0000 There is no need to have a custom memory resource representation for each infrastructure (PCI, ...) as it would always have the same members. Signed-off-by: Jan Viktorin Signed-off-by: Shreyansh Jain --- drivers/net/szedata2/rte_eth_szedata2.c | 4 ++-- lib/librte_eal/common/include/rte_dev.h | 8 ++++++++ lib/librte_eal/common/include/rte_pci.h | 11 +---------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 6d21024..1b9e88a 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -1416,7 +1416,7 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev) int ret; uint32_t szedata2_index; struct rte_pci_addr *pci_addr = &dev->pci_dev->addr; - struct rte_pci_resource *pci_rsc = + struct rte_mem_resource *pci_rsc = &dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER]; char rsc_filename[PATH_MAX]; void *pci_resource_ptr = NULL; @@ -1473,7 +1473,7 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev) rte_eth_copy_pci_info(dev, dev->pci_dev); - /* mmap pci resource0 file to rte_pci_resource structure */ + /* mmap pci resource0 file to rte_mem_resource structure */ if (dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].phys_addr == 0) { RTE_LOG(ERR, PMD, "Missing resource%u file\n", diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index 3d0d2b8..5c314bf 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -100,6 +100,14 @@ rte_pmd_debug_trace(const char *func_name, const char *fmt, ...) } \ } while (0) +/** + * A generic memory resource representation. + */ +struct rte_mem_resource { + uint64_t phys_addr; /**< Physical address, 0 if not resource. */ + uint64_t len; /**< Length of the resource. */ + void *addr; /**< Virtual address, NULL when not mapped. */ +}; /** Double linked list of device drivers. */ TAILQ_HEAD(rte_driver_list, rte_driver); diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index 4a37a32..2b36727 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -108,15 +108,6 @@ const char *pci_get_sysfs_path(void); /** Nb. of values in PCI resource format. */ #define PCI_RESOURCE_FMT_NVAL 3 -/** - * A structure describing a PCI resource. - */ -struct rte_pci_resource { - uint64_t phys_addr; /**< Physical address, 0 if no resource. */ - uint64_t len; /**< Length of the resource. */ - void *addr; /**< Virtual address, NULL when not mapped. */ -}; - /** Maximum number of PCI resources. */ #define PCI_MAX_RESOURCE 6 @@ -160,7 +151,7 @@ struct rte_pci_device { TAILQ_ENTRY(rte_pci_device) next; /**< Next probed PCI device. */ struct rte_pci_addr addr; /**< PCI location. */ struct rte_pci_id id; /**< PCI ID. */ - struct rte_pci_resource mem_resource[PCI_MAX_RESOURCE]; /**< PCI Memory Resource */ + struct rte_mem_resource mem_resource[PCI_MAX_RESOURCE]; /**< PCI Memory Resource */ struct rte_intr_handle intr_handle; /**< Interrupt handle */ struct rte_pci_driver *driver; /**< Associated driver */ uint16_t max_vfs; /**< sriov enable if not zero */ -- 2.7.4