From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0068.outbound.protection.outlook.com [104.47.40.68]) by dpdk.org (Postfix) with ESMTP id EB5DC72FC for ; Fri, 16 Sep 2016 06:33:06 +0200 (CEST) Received: from BN6PR03CA0042.namprd03.prod.outlook.com (10.175.124.28) by BY2PR0301MB2008.namprd03.prod.outlook.com (10.163.196.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8; Fri, 16 Sep 2016 04:33:05 +0000 Received: from BN1AFFO11FD023.protection.gbl (2a01:111:f400:7c10::191) by BN6PR03CA0042.outlook.office365.com (2603:10b6:404:10c::28) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.629.8 via Frontend Transport; Fri, 16 Sep 2016 04:33:05 +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 BN1AFFO11FD023.mail.protection.outlook.com (10.58.52.83) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.619.6 via Frontend Transport; Fri, 16 Sep 2016 04:33:04 +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 u8G4Trg3029256; Thu, 15 Sep 2016 21:33:01 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Fri, 16 Sep 2016 09:59:56 +0530 Message-ID: <1474000200-16705-22-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131184739850372868; (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)(189002)(199003)(85426001)(87936001)(2906002)(104016004)(105606002)(86362001)(626004)(106466001)(575784001)(77096005)(586003)(11100500001)(110136003)(5660300001)(48376002)(92566002)(97736004)(68736007)(4326007)(189998001)(33646002)(50466002)(229853001)(76176999)(50986999)(47776003)(7846002)(19580405001)(19580395003)(8676002)(36756003)(81166006)(356003)(8666005)(81156014)(50226002)(8936002)(2950100001)(5003940100001)(305945005)(2351001)(7059030)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB2008; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD023; 1:bjRHIsOL6W5HCb41F3BMUNpygMoDEXNgaPm4k5I55YPNrM4kQ4R8CIcd4RYssdDrPCSgIHNx+n4KPmBKdubnXGJ9NGrdzzxk2U3wb5gp8noVSnG40Imr+OGIBc9tK4W7dqo5yw1APXpoi2HYXun8oHLVg6GCsG1NszjkPfJpZl0ouNoiB1JLfcn8Q2/yGAiUHcH0+xtckTxmSIf/wzBBGSuVwfySmeraxeZctek2tv0YpAjO9xVLHhm6aB9dm3LJ+2UA8OTFmFRrWAm18evBvy6OtYeGQzpBDifzVjT02vocafnu51sUuoRTZIIvNcqbXa2N+7jOA0LfMEt8xL0PfX5bBd4zdI7lDEkUC+nfIheEgDuyu2MKHM2MppnA3kIGVNyeRU/+tIYU7Pd1BbRJYKWfB0cQAnncw24WhD2mX9++FqmGPlAGLlnLzUyLZfj5A2GCTfL4MDsxk6wIbAEk4UPEohCHKjWI+R1lYoorkpYRQG3/8VYalJE+pWelZ48doF8ehc9Cspoc18RV9X9u/kz2N3diWNU6QsyROjp0fIsGFmQvrJIZZY0SqLAvoNEN50nUedVkindCOrvDG7wEkWPh8RF+gpxr6ZSwB7K+sdNdqgcXE9pPCT0547IFMewFV1f1RzJRnVwhZEYKzMp615gG3gyv8mqPS+uF/gPadGXQkefbma9gbRXZaZxRljmyosN8OtEIB/webt1y2NOsJKGYOX3FKz6dvttWilW3k9Y= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: ea4ff372-4e94-4ee5-65a3-08d3ddea8d30 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2008; 2:tOnOJP3x1Pvu/jjnK7UZkQrpeCG8kYsCm0PHosJ/Ig2S4aqjgo34dYJcqLxWexdwySerEfVhg9QBYohLDbDhlyHJeomNpmRz7aOioYp8oDQ2rc1oHRbEpWXhpNtNuHE8d+tBepr00WV1Co7DVEVTThvC3ZvizWNUIulhERIaWSmAVX3S0oAOOZsppS+Otx6T; 3:i6K6ZvfJuGu5i7Bs3xBiBoOrttsEB6swRI9KoEbla0umki2eUdbJY2Ln+nnHU23oSIkcvUyNDQfMilaQgvR5fOl/uqsAgp4xX0jJPwoN0iSdBbam1ZVnzv9ygZvWe0vOc+SgHb36l73tOJ9gzr1RUGyGCNq4BLr7dHjd5wNu8xq+Nwg+xkuBCgJSSUGkzwE8dlhA5fUTTDJooAP8KKDi80QVlAuvBdBy/FmnzXhvP0g=; 25:N0hMLphrqFwYw7oOS0iK8QxRuCefJQgBf6cc51X7ZbIPTD7j3fW1R7UBzf9Cvqy/OJoElPZ65UndqSiDd4VF6mytvormEvGFBJy2AKY2NhGljFPhS32A9f65iFPQIDLpO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MvZE3PeluhDapjYDK3AagQEJnN2NnyDAqCMoHaVUzhVj+jJU7VgiVta8UDhjqvgTIcJZ0b6nGOe7mOQeti6CrMv3/kFTuB1boJqCCRc/7/9AJ/BJiAFB9dkDe68k= 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)(8121501046)(5005006)(13018025)(13024025)(13017025)(13015025)(13023025)(3002001)(10201501046)(6055026); SRVR:BY2PR0301MB2008; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB2008; X-Forefront-PRVS: 0067A8BA2A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB2008; 23:ZuBW+Pm+TT2p2QjKykYwQatO5EYDn8gTZGWutgf?= =?us-ascii?Q?BxasVdSn5IX0PTshLc+JZIiwNXvWfkEJXi5miQFP+VuG7oKuBe9XCNWv5BIe?= =?us-ascii?Q?zHeRLXqy6TCk85kV5WmAY85T5FiMMPREj5O2IcH+x+Z2ZjjNIvvgqZkA9SQP?= =?us-ascii?Q?o66fFeTQSZpNWRLAGCpY+DK5sQbB3tN57RUA6rY6RV3RXt+uwtw5yEzHNjLY?= =?us-ascii?Q?zgdz+LZcSNsRw4dG86UGqGLiU88MGvV93bVqEvj7lNNKLTBsPri8PGEPfkLm?= =?us-ascii?Q?UL/lmhwjwEyyfn02uA3YIHiJtGZfkq0nsqjpigrESYoIaw8jdLDne0x68HRa?= =?us-ascii?Q?y/OOK8OM3mHrK7bdfa+lbgkWuaZt3CgjrRAID5b0BCHlChUdX9E1xmYkXBSe?= =?us-ascii?Q?v+4A7iKv6IgsoRjhlbNGCz/+B/v6clAT/L76tuBuJT0IqmmerlcLWFA5wbWy?= =?us-ascii?Q?PNnT4LlRQV2u8WcF+PkP/YVH1unj/hYzIN55ZfrUrFUfvhO4dJdjojfm91zS?= =?us-ascii?Q?Vv9iDmVoS9Zll4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SykI3VkzxN7KE3XgAD7tfnVBXefChsWUfdQD0kUvy+irOjxXwbFpxRCM7UGAg3HucOPpXRh6GAehiXDK5kl1hRRgoC5E24ZQysCmbDJ6VzxKteIkguGG30y+3bdnnxaSpmyUJE2oDBpnEml+GvIq8=; 5:w4bWS2AP9VMOTbSYz4guv3L5eV6HsB5KeaQxToqxkbesxgctUMiSP8bZUhjAdppJA0mmns0LkhaXiphQY7fAvlbFvEfE5KYu2s6hWixa/GkaeoHLF466xzbxvRKEGgK5Rz8vJONRb5ibzDEtBjsYqArLCAlbqsv0YbUj5CTCLtI=; 24:Khqv1S2A67DYcL0jXssvMqDtMijpKh498bQVqQ/DVhrJc2n4yJGE+daju2qKyB/VqM4ZULUK8dZq8cfsdHom9cXBRd83GoH97npCP0pzQjg=; 7:JfiPGigehS1Kxw+Lw8y+6jWl4hJExotuf/dWeRCvxNWEeos5ty9knxk0O2FYdOMLkYulgw2Dnv9VkMAkq9eJujMcvyVWdUfbWuQObR6DdNWFJgM81UOazjRHJscMy4aBMpIwHa3dnY+W6pLFVCLHmSFC+kb9/1T0zakJdu/eohwBM4Gbsk1zEGcIcdTjxeu/9wgcTelsp/dlRC1mO2cFkyIJebf8sh6fa5XXOMKUId4cVHGk9CFSBBl0yeXKbXKj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2016 04:33:04.8500 (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: BY2PR0301MB2008 Subject: [dpdk-dev] [PATCH v10 21/25] eal: rename and move RTE PCI Resources 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, 16 Sep 2016 04:33:08 -0000 From: Jan Viktorin 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 | 12 ++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index bbf97a2..ad5f74c 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 bb03d41..67f6ee7 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,8 @@ 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