From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0068.outbound.protection.outlook.com [104.47.37.68]) by dpdk.org (Postfix) with ESMTP id 4122491FC for ; Wed, 7 Sep 2016 16:10:24 +0200 (CEST) Received: from BN3PR0301CA0036.namprd03.prod.outlook.com (10.160.180.174) by CY1PR0301MB2009.namprd03.prod.outlook.com (10.164.2.15) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9; Wed, 7 Sep 2016 14:10:23 +0000 Received: from BY2FFO11FD033.protection.gbl (2a01:111:f400:7c0c::161) by BN3PR0301CA0036.outlook.office365.com (2a01:111:e400:4000::46) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9 via Frontend Transport; Wed, 7 Sep 2016 14:10:22 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; rehivetech.com; dkim=none (message not signed) header.d=none;rehivetech.com; dmarc=fail action=none header.from=nxp.com; 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 BY2FFO11FD033.mail.protection.outlook.com (10.1.14.218) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Wed, 7 Sep 2016 14:10: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 u87E8BD6013556; Wed, 7 Sep 2016 07:10:19 -0700 From: Shreyansh Jain To: CC: , Shreyansh Jain , "Jan Viktorin" Date: Wed, 7 Sep 2016 19:38:13 +0530 Message-ID: <1473257297-7221-22-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473257297-7221-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1473257297-7221-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131177310217138655; (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)(356003)(8936002)(8666005)(50226002)(86362001)(81156014)(19580395003)(50466002)(81166006)(48376002)(2351001)(8676002)(626004)(575784001)(2950100001)(50986999)(33646002)(85426001)(19580405001)(2906002)(92566002)(106466001)(77096005)(189998001)(68736007)(105606002)(110136002)(5660300001)(5003940100001)(47776003)(586003)(104016004)(87936001)(229853001)(36756003)(7846002)(76176999)(4326007)(305945005)(97736004)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB2009; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD033; 1:L1uvfYHH9SwiSv9aGHnyueSCxNedNUo17SgLMOlJmaQEJC9+0yos+4UG1aq2GrQsO0mFP71msdyTSPz4P/z7ksbfdqtYGEIc7pbosRgAWkFJP5VfR0DoZTpeu7OvwKtEVmbVEBOIgKMfHh5msuVgpcbcHJCHwBsEwHR1X1mkRb5FAx5+RMJy7kGUrN77s6jrTz3nHZcwO6+a0vfbeJRdeJSrpkzRCFj/P3m1I/26muk+WXcldNXDACw9qLnheEIjEYUIYq5E8AKpmtfDUqIw6hFJBuKwzIG3S92bqOSm/hC2/g2+YkViO3LWcaYgJLCv76Ku4QIZ+uOdV9ijDxLEBDwsZ0xmfdn5gA8fvQsiCrvjtk0lt8XFIAmLZuqg0g70KG32lLMPg976edBm1sd5ZBYezFql+QRtMuYaI/39rAcKjVnx/ygwpiXbdaLeK8bCTl0rz0YmSn+jy/1uMrUzrvCCvF7mzWdYqBraGRGG3okugMTgpLaPJy2Jz+dclghQa0QZC9orXh2dJUuNCCae8heZVsXuLmdkGbGd70yThwRzZTUozYH3tPdvZhlNAwLx67wSITyTFpaYoAbHmj489xUbrQRnnkkJcPXmDNArc0HFJkMG9mgri5amJv6pWscI MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: d5de5051-d6c2-4937-71df-08d3d728b48c X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2009; 2:AAI7NFcEzndYpwFESqINqDFyY/TI4cpq/HBsxGl2aZ1NtQ6pE9G3V83Q0Udz3kCmhbiT2pInOKe2C5Q1ywC7kh7roZpHPTun+xDWSMQxHmjlrDN6oD9+FmK8zj4vsw8fM6eiJ/r266d463tUZHJOTM08kN/KDHwQbNbiQgJkdN8QTpNThGOhn/HS6thU34l+; 3:xBBCUw8/yWzaC+2RpfECofJefnVUY9vvJsNKF+lmixU+76LquGyrAtGRs4zsqWATlcYzO0LWYz8I20GDB8zZ1yI/YE1BC1xm1DsKz7nQwzy4wgb0o7qBzTTb6Z8dBJdvF3wTxNVac5/8h8zTQ+ckSqGNYXjD3muKVU4sHp7A/EYG2ExU92C62qCD4IGDC5hBm5CLd0aMWsbKfFpgb3kXdPmJ9oDSgl3oGRbFLx4ALB4=; 25:reVStchtn9S0JEnK/o+LmFdAjN3tPMrkQamCH0teAgYv9hHneD7f4hydoaJwiBPzhmp12Jmr5eG6onKfsbDkJ71iu+LY6tNM3UOcQB5TDQT3g/yeU7xuMh24yNGXmgTP/uhMGNANV50e2cTiqW1E7OjnkkRoa6rRMjlaKMQg2RdrOghnTzYnKQyKdgvWT4HtnSOl8RTqHuGsX3/zzVOCK+yDJBvtw0SDcUL9cZqgbXhtDshB4gM66Ll2fVCHu6BTxYHl9G2jpNJWoSTI1CWtDRCvK2olBUnqpsp5PFwdCEP9+IOoATlBkz6JD9lBfPNPeIPk2BZaJMFJ68KlGZPparOSNQ5EuPE14z9YETgKloQEh1TYqriz2gf/W7CLoi5vRL+iFNZlw/SC5mh/dnDDckcUcxb0wGcuPTKHdtBpLLA= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB2009; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2009; 31:93DChI6HLYBglYI+0FNUcrRd2OBYGVv0D2TynWLFGnUADsQG0Y8zeamat1Mm/S78++v91xXtoiWQANWJl7t0WfcVgwfuoyqw0l/NTr9qCyZALFyR7GfcKeY/FpVnLMprykGrqyHtZB50MipnmeWelPLIB84Ar48BImNqkrrWK+ao2ov6QDFQ5gH1NtY5jvzgq6FlotEjl/IMbcpe4t2Uriv8q4BqT733OLkrpNf7++U=; 4:pwBpGt/kdkdDQAup77V7hAXkGxlkRbJTDUX9fHKN2MZI22LEyzd/vMiytCuxmn8OjZuxCPj/pvbLaZkjLi1Jd+h2guJeUuwfkARTNCZ4PSbuRNte+raWgQJx9wK26XoqAy5fqZE3/vMEAGl/liq2k9nGw1I/P8B9Bo1rInXAVRib+3dJtLc9AKrqNcyeD3/v9YDp5zpcnIrPO5h6QDZmdBwq54b8f4CjJSlSSftzt/ayRdkyT1nZd7rh83dWctWkg5DSMlHYTkaQ/bAwVaOnDJY8peJjOvgDk+roBQeS0IkijnJhM0v8oD/2AWrefIUiOpQ/0pzyOLBcS7OFH9AorYg7Km3evPhBmPWG0NffO7meaVfAZgX9W/2DawPGyc4KtibBd71sjyyMtnqz+FeFm/0/LhD4kDxT/rZsw4sYRqLbvQ2eH//wQjtioBZIp3sd+OKsUE8AmTviPuWiAkROltbUJZ6yLaoUS+bW70buAJ5T9GOLOB9eUCToRX8v2y+yg/4sj66z5pIfgW5cY1BSGwZngRFTWGfDwPfs6Bc3ZmM= 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)(13015025)(13017025)(13024025)(13023025)(13018025)(10201501046)(3002001)(6055026); SRVR:CY1PR0301MB2009; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB2009; X-Forefront-PRVS: 0058ABBBC7 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB2009; 23:pIUnYVa4CC3oIr45zqU7K+CNbW7Nruhb1mi3HtV?= =?us-ascii?Q?NtWBubrjbNHBUjkyZcQYVPwBcZjxQYBULQavgmSmfKUD2FrdRVgAeE39AJIX?= =?us-ascii?Q?8BcGoW7CTgihvT9WZrjk0v+TmoKD0Xte8j5D3PJBYjts6GzWSWZL9atl5x5D?= =?us-ascii?Q?vPvC9E+RRYvhh8n89jRoalPpaXKa0qkHToenrEzdo3Cy0NIomHgkjUqTCBo3?= =?us-ascii?Q?3BlGN9hktfT6E9DiGUW7Yn2NDlZwfm3NR5cgvOeJ6Y0QPLSiv1F4c9vvurns?= =?us-ascii?Q?w/gia9fgbRqDhoSlLwcx9D9ohL9yYrJJwwK3SndMXHccAtO5GUTWzn0lUs72?= =?us-ascii?Q?3Sy7MEXfaQL3V+JFZogyZqp8iwoEWrhWAPaGxnJvSeZl42nMQAi1y1nJWgre?= =?us-ascii?Q?DX52nbnsUsbk0pi/oOr5RQhtAA4WbE+moVHOHwANivAYfaT3gRlptZMzuw66?= =?us-ascii?Q?1ujnr51L827c7kPPQec9wCo7CmqNjCBbe3uMTqoCk4jf9HrSJ2rCGZOcFAn5?= =?us-ascii?Q?ULKcc/hMPOI1EtLu4kD28PF8cyHHtqdR1S12fWbLvvUf6UesfQGvN5lGRA6Z?= =?us-ascii?Q?bvEJDngL4m8Dl1JQ2x+V11ieIeI5XEnF4h7DZNngvdrJ2apKvf6YtSzvCiD5?= =?us-ascii?Q?UXcjw+JFJDFGPCsH2IVGosD/gLFA6Vb2x1RHP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e6THFv1GcHc+6ZMYW5wL4w3S2JUYKlJaqCTMzibDjcInkMdRShAkYZJvmz4=; 24:JRnen187e19N5W1rkOyQw7yj5CL8+tFqadjSaagELcKEDY8nIuoitUD0tR0OGn33Czu7b2CbH/kSUY3FJUj50Lu+DJSI2Br/JXwF1opnaFQ=; 7:QmLQkTgBGIZ4NVw9n/UwQhf//5pzrXvddTWF6THiku29uEtQxzmnD359sZZIlb5blvd7IpG06tNwR4lPTOXbgbxJSBz8Rute1cHLRkuDoZkjr0Hph3KEUggf22k35Dev3cFh0M0gdUaGfWLhydhVjwXVBDZgBZEm5zRRI6B9AkxB1aigQlskqD4jsHZ48R+ltACVdfnA3Tm8saryIezga3aIudqNGliTx17w4YNxCgcLsf4jyUir55LsIadI7eF1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2016 14:10:21.5266 (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: CY1PR0301MB2009 Subject: [dpdk-dev] [PATCH v9 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: Wed, 07 Sep 2016 14:10: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 e8e05da..e2d457a 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