From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0042.outbound.protection.outlook.com [104.47.33.42]) by dpdk.org (Postfix) with ESMTP id 3AE358E65 for ; Tue, 20 Sep 2016 14:43:05 +0200 (CEST) Received: from DM2PR03CA0037.namprd03.prod.outlook.com (10.141.96.36) by CY1PR0301MB2012.namprd03.prod.outlook.com (10.164.2.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8; Tue, 20 Sep 2016 12:43:03 +0000 Received: from BN1BFFO11FD051.protection.gbl (2a01:111:f400:7c10::1:190) by DM2PR03CA0037.outlook.office365.com (2a01:111:e400:2428::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8 via Frontend Transport; Tue, 20 Sep 2016 12:43:03 +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 BN1BFFO11FD051.mail.protection.outlook.com (10.58.145.6) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.629.5 via Frontend Transport; Tue, 20 Sep 2016 12:43:03 +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 u8KCexsm006559; Tue, 20 Sep 2016 05:43:00 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Tue, 20 Sep 2016 18:11:32 +0530 Message-ID: <1474375296-26078-21-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474375296-26078-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474375296-26078-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131188489835897069; (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)(1109001)(1110001)(339900001)(199003)(189002)(586003)(105606002)(50226002)(85426001)(87936001)(48376002)(106466001)(229853001)(5003940100001)(2351001)(92566002)(104016004)(86362001)(189998001)(68736007)(575784001)(8936002)(626004)(11100500001)(5660300001)(77096005)(2906002)(50466002)(2950100001)(36756003)(81166006)(81156014)(8676002)(50986999)(305945005)(76176999)(356003)(47776003)(7846002)(33646002)(8666005)(19580405001)(110136003)(4326007)(19580395003)(97736004)(7059030)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB2012; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD051; 1:I4JhVU98ETQmEXf2e5Mpytt45VLoe0z46TccOdEeJsWj8tdJCcAMQLDRbCkeun/wT36JGkCxJbn0wgdhQW4lzR5aBg5xw3uXPdXRORVGbJJHT2SW2yWXAg+aXLipBM8AAG7IsWU9c6SeuuTbZaLPTVfqk3jiefdCigycfpz5zIYtUIsUdJApIW4S+qx+Zi/hctru3GqFdStHnDILuhx/9NCuIwbemTG+iQxC9nmsV3wfivvYbgL5mjVxLTVBBY6+VkRwxq7zTViBfOjcYsGxSL7P3FZcG5ivyPaXFre7wTs4Xlcy0g2dhXgPX1Rnh7vqT4eMdaY2xVyj66HbZBFzG/sDJoFWzRFS1NjecaBR6uHgepLaU1plOkzSquN4quTvnVlbNv/senxgqGaVAWQvAGeSSLa3F2WCz1ELzKGRp29yz88n4asR6CWHpyM4Hl6Wxfe0usecbgv/wKBycLCN0WsLgWe8xef1alkIDs8EEEcblwWQesGEQjzjGzfgf2oZbmsQL6Y5/raLB7yqBoknEfba6v3D0HWBL9avpkLzbCpuW8AqW19JzcSKTlQEhntMXTxRUVu0mlt8VhgA5znlvExvo18gr9Yf2YIIAKYI7YvVi+iJQkwDjPYXcPg4BpJnneQihxLcshL3a+6jNJ8EsczojGzpbw9L4nYPGE2CMV8qZVkWX/aRJgUPWuGvV5xuyzs4duz/9CMobxK6rRsHfhbE3dSoAjEzG1N+Mc30tE8= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 04683548-d238-49e4-d605-08d3e153a9ad X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2012; 2:90tnwzlRv1LrdVpCLAE9PKfPo1tYYmZ4h0y0g59tpYAK3/MKlu4O5W1eSS4D073ThUzAzImrMqMmV/W/V8Nlh9L4f5DAEQgFi6vFKcucBDP9xxJR+5DaKcO8jISx0YdwermftBytZ6r3wzjzjWN9PBoeP/ODe8F8rPAz7hCZM+meC67nmiWfy64yzjuunV4q; 3:x5Ub3UoLS2qnkQ1ViqI3pAKrQoLe0BRDDJrP1XB158FdbusxJs0rbRtZy0pW8alArKezRvH4UX8VG9YDrO4S1Dcbga2Jl/xjuKsNqZglNSD44TjxEBJlxblRouvyo5/N0YvW0e3+IEsq3XmWeAnTi2NJrGscJE3rfFs0RaTw3jQISIj0He8YgRyn3BlOKL4G8yTnf/HKoy2Li/FNrwERDuQE2CPEQO9ksJAbh0cDAgo=; 25:y/k7JZhNV74hyFlaHQN8d//yWRUiS8BdK/ThHfLnAjucnmeuB1v5+/OkG62ORTkJ/eQUR9tyjNtCpSvyO861NyrbItFwGFiE4Dgm/jWup95Vz2k0+fiOgazt5nWNHrtdgtpv1W+39a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PBm6E7k7Rt+zZx7H6qqSbB6Y8ITPRQsUA9LWsdlxJ2CP0SxFVMPI016hE8tBaFz6+imkZB5F/3Rq3KwjgEPVWwp+kVq/NbBI68EIs8= 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)(13018025)(13017025)(13015025)(13023025)(13024025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:CY1PR0301MB2012; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB2012; X-Forefront-PRVS: 0071BFA85B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB2012; 23:kxE7U7OjcJCLu7pRa/+okMXPKuLJ5nGvoOyWz2n?= =?us-ascii?Q?S6dUR4wLf3AnXwpgz2bOuYVNanZIj0pdtl969PrcItkIaWJ+f8VsUzI5/MwU?= =?us-ascii?Q?Eoh03HEC98yH8riIfKE8bTAYjYfafUkR5VE4aeOBLz/8sHTLYnjOVd5ps5G3?= =?us-ascii?Q?c2KRKRo1W4Cset6ezyFRmMpZ4kzN4DzZaFUkVB+9X9DC5iAo17gSROTewzPn?= =?us-ascii?Q?AWL9deMuiwmpErMp88crM+US2oH7d8IerG9GxsJifdpXYPsKoHCbR3C6Sdvv?= =?us-ascii?Q?Ew3Ic6OO0/Dq/okm2IyG0HnygKHSXU1JRxmqp6XLQtFBjLLX+0UiOYvtXfZL?= =?us-ascii?Q?8RocnXtjF61Lk95ZuqPaJqWeiw9CWTCPbvXS4FShqO3b8RlljOipUt04zIEL?= =?us-ascii?Q?I8ZSMN/kW8f9ZDr6m3Sg3wPRSKzV9Uy/KiJhXYKvj8wF5WNT/gaWb0nWqD8K?= =?us-ascii?Q?zHpiWAS3MFjvQ8yTEURgCrhqI1yzW3ataOFlo7wmnW/hMJN3312lOfrdUr8S?= =?us-ascii?Q?FH2zYfGymB06/l8qcWQVIbmYzyMX6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DdDQKqCCfY62hfvQpv8JHVtFOcPBhNty8ewxmlPNcWtBxB7Wy8C0qZvZy19hHs84zsnDx0jadiGNKjmhqQlyYP0HHYBtM9vEzgH8szAGmu77KPnaythKy02j4CIsY2qmAK6zk5pzM=; 5:ayvnnNbz3zIZtMlmrQTEv/7ttfxTs30KDDTT0jQON9Hd6AWToRkjY9nX0sp+YCTImR6+0zcm9e8BWCVkX3b/y7ZLsBgEp/Dfo12nnL0/ovguayNB8BDHKXRx1FmoOFQkTwOQI7Mwckj2cQ0PtvnFAsgO1R61L92z3CN8NkZtGXU=; 24:/CJLmJxhZ/hW9+EFuE/RdMvyDcFFOj3m8se/iobn9X6ijwO8XVBaQKPv5+jN0FvXmRJUZbHfL0cqKwMfeh+8Pltaljc0oZHq9BhbQxFsA4Q=; 7:b2uFDvYlMDzPGhutDEFbfvv/4nTnb+G2CtTvd0ivJeFnYvvQzECP4B5VIYE/GC/gAe5Hkoqt++LV9FQ4yoWYZeab8KFIBeu598yFhojV/5DBFhiUgEA66IAEf2XMsfoUipvRHLw+rm48mk+4FCHnTGYtPHszgMHtFrZWAWL+ReSb5pbxHSjy9OePjBo9Yvc6zW1WZtZ4/yiMDHFkdwXFfIWpugS9UFajMwlK4ycm8TieWPxtGPfWiio9/HpGjy+yoZPgXtq523DPnEQRCXOKW/x6BOzyIRM+xamSY01ecsWdYDwHsLeA1O6NA1aYIVJB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2016 12:43:03.2777 (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: CY1PR0301MB2012 Subject: [dpdk-dev] [PATCH v11 20/24] 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: Tue, 20 Sep 2016 12:43:06 -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 9302200..f117220 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