From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0084.outbound.protection.outlook.com [104.47.41.84]) by dpdk.org (Postfix) with ESMTP id 682AEFA40 for ; Wed, 14 Dec 2016 02:59:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=uj9o+CVkbY1TQFpTqPMjkhrDaY8SsaVeAmNluKZNvyU=; b=oLuGgxnOHH/q1v4vEkvx0OKW7zDCdc5SPZHsyHFAPQJyqjRffm+ajY0avJPaDJ93JoEDsvtRCScgfB04itFD5RwFx5EeJsZQzrEE0e5ltX053knSXqK9Cr8xp8I0VFw+cc/OhdvbcfsrkOw9wP/OvZr6PyoMC+l+VNuTqBn5y3M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (122.166.91.229) by BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8; Wed, 14 Dec 2016 01:59:19 +0000 From: Jerin Jacob To: CC: , , , , , Santosh Shukla , Jerin Jacob , Huawei Xie , Yuanhan Liu Date: Wed, 14 Dec 2016 07:25:56 +0530 Message-ID: <1481680558-4003-27-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1481680558-4003-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1481680558-4003-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.166.91.229] X-ClientProxiedBy: MAXPR01CA0006.INDPRD01.PROD.OUTLOOK.COM (10.164.147.13) To BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) X-MS-Office365-Filtering-Correlation-Id: 5c12b7e0-fd4c-46c1-221f-08d423c4d2fe X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:A7Vq5+NhsgET1OSad5Rp90A7b84g0EzVRby74qpdXr5LcjlXxHPZTDmZomq7c7Hk8K6PPb+/JCS0bOuM7QSZTtJ+9l/qQsEJd/sY2zTjw7nJzFZWaPkdOVZD402rUba1egGKG9Qp87IQJOpgsK5fB+KoO9Eu7pivRCBvTw4qYb1m+s3+cXdvBWRYtw7OGYxvvqsfvfAPicV6W05K7N6wGDBBKQzzliCwk8Qhti+dms3WHb1hQEIAlcmqsPfwHIIJDm+wKNWelFQxQFKmgxpK9A== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 25:iNPNiSEEO2OUZj8GvEImYvb3HPBKATtApAuDWDaF8NDvAV6vh4IYsuCR3WC/3xxtLGXRY1ssiwEjcmZtsrdhyO5UxG1EX6P+52Ln0V59BoraHr5OIZJxUpLe3Pe3Fkc3/04kAxpEf6INWwT6qJ65n9Mio9C+jh0bLGAgJpbLsdq8ul/w6Fp6tmzh6t2Gy4+B5j9atUoXw1ddoJxHkDO++E3gMEkaVnrAjFVroMvZ7LrRY+Gk3jpsnF3E3YwkrmewK6/d+gid8tCQtrK23qOTcW/gjYCeA+eCtOQKTuFd9FaeKZh9ThFGtjqVnzMlEkNQYY3AlXHlTk/BhaNiJckw+m9IoL4+GpDDE0BTejf2R/kUxIN6g0eH3BNA4ATNt6MxLKd9nMTc5JTSpOOkDZm+XrFWGYIYylDn7yMtq7EfbMPlhRpQjDGPhEMZuvI45HCSkYZUoSUngZu76wfrLsoRQNTzCdZiNBXr8tBgSVMpm7397iNfLEcqEcww2Zr4K++6fjzF0ycf3kQmZYOWnOyLU7l9nKh3yJ/V3AbSf1N4ZmnwTse7T2SOV5hClw7qzApweQ971mm2kvs1yy5w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79/9nEcjaldMngHi0SI7jAcOym53h4+0R5mdYXYwab6+gE2+TOCsmB+TeHP7kgZibToe4+JRov7JqYc/DX50= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(6072148); SRVR:BN3PR0701MB1719; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 4:Oj1hy3SkvdOPLsL/hA3S60jUb7zMTS1Bu17a5ULGXleFXsmnSDhdsoqo/HXdlZOLbGM6ScOqJ/YAfsr5ItnmO0R9O4Yvd8v2GwYiRGXUblrblNgSGV7rdYFrniHXDYS0hoXPmZumnHv7NdrEbmAr7bdaiwPAW3XbBHIzh25hg2WsxbTIovL5uxP4r0bwLv0XJv5d9j64c1aAJOV3poHOwmoNe4JZcz4MxkdIuGEN9Rnn+RFUk/OKjYEnKGBwtki9aBnA40ir6FRj3bLvWUl+lcjeJQorJFmzIPX5m2TsgYwxHg2cJs04507ZGmpyk4njklcGVkno8roctfe3vmXvCX55B5IV/gbPpH3gMOs7wO08WlfD7myfBP8nJqlc4CGQUuYJbj76zAsJuuIt6ysh8YGsdOoMeUtC1Q/CTQr2tzsi9bEEyOEzLnesLgQfwi7DCDSaKZTzOrMJQJgkpHxELRkI9L3jPBzcOdU0U0dEJlxn/DiydomCXJlPv7hwUWrnOA5Ki5yCkb+7jvH/fkvZyjoxzrl9pznrSkwajTQH7X5kNgBNyzG8Gc+Vgx5dy6PfIQV6yzSQfx4G07eNIEl1lvQ1JBgadhSqqs7y7e+r4ui6DtJNA1knAGV06tklZ5LKmdIyauD4lqubc39A5B0bJw== X-Forefront-PRVS: 01565FED4C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(39840400002)(39410400002)(189002)(199003)(6116002)(6512006)(6506006)(6486002)(3846002)(66066001)(68736007)(47776003)(92566002)(5003940100001)(50986999)(76176999)(81156014)(50226002)(2906002)(110136003)(33646002)(6916009)(101416001)(42882006)(2950100002)(6666003)(4326007)(81166006)(38730400001)(105586002)(8676002)(106356001)(5660300001)(305945005)(48376002)(97736004)(50466002)(36756003)(2351001)(42186005)(7736002)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1719; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1719; 23:VuJ1IZ4RrzqmwZhSJUBwlunfbJ3IUVkhHCNWd2H?= =?us-ascii?Q?HwxUm9PgBC6fNXBBSMmeWphTdhSLmb0PgX+Ij3Y2KC/IodURntzd54iKuNQ4?= =?us-ascii?Q?JNBikWgaXrGZsgNsFka/Hupm4dCcqcGrVoK9RvLzHt9LRLAj16L/Z+lR2iVO?= =?us-ascii?Q?++TSZLhASGoMfKgLrdq5hjUTDiqmH7tZxH8gdgEWcqVZnR8EW/GYjqtGrPzp?= =?us-ascii?Q?BV0j5zCBUMXHOvNLvc9uootMtKtAEkj/y2gpBiG1w01laPtEhMKkUdLswJLy?= =?us-ascii?Q?GXp1pzyXTwDeHna7lappMsSN0QAXChhVx+fJFcVtJWyac2rMzq2hvGt52w8W?= =?us-ascii?Q?TzQkWmam6nqyLaX8DUWvuD/S5ca4081g7acxHdOfw8azi76iWA9Uwi3Zz2dm?= =?us-ascii?Q?L34koHWafEugzbQT1KJ7yy+pa1BqRxs2XsDiDobIvwb5tsbXAkPUfQMKNvsn?= =?us-ascii?Q?Kh8iMYMcGjUsRtqwLyue9mMpty2g/+OukgrevscamkDO8RtvNsthyIf7reBH?= =?us-ascii?Q?QDb9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M0QtcyydK8I3B3tK5VVs455BGS5rcE5FfvZT0EppA83w+Y9x5AwPk241xX5YKQmtHpvl7BwwTRkPvxz4ESK/F6q5YeMgzvaQcogQPwCmHwfT3WxOAFOHFUedXOLiCGlRlMuDg1tpgqVj2tATQ0tlbWPeD/FDNTt8t/o83mj9M0=; 5:tICQmFy4MYUJcqve9hOJLIUqXkZiEaV3xK+N6h7vkiG1t0RcoDX8OU5kXnGzqb6i60WTpE3QWrCqj52lFLgeE3Y7us6JWO8kM36dNwAMjKuHOwlnfj7R0M62tAhPp1nsPpzDBMMCiE5EADqELbxA4w==; 24:pGj4f1DcqN3QvlOtoIA85xwr5GmHZ5xg0ysMuXI351Tkx48pz05wOBjlWVa5VgqQOeV3ur7rs4NdMzOQOEqDtI8d+wdNCDHIwstSKcP+oDA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:U/+VE0Aj6KViKA7oVe4mEPnJul0t+UddFDf4Y47jzgSWZflFRtQSSOtRwppom8YWjBmh4PVSeg2Z686Wuxp2jZP/H6WRnmvKJjCzyfdtxXeeJMnxrUWwa8QGZZ/sXnDONtmNtFyyd3AG4oVMlii0VDcRFCd9Dwq06NECsmHa7zP8Z8RFfr9kUgiv7mtFl4x19RFwe9sAbyzFmntFccZjkazElxKF8gBvBhJ54fzTOJzzGRAIIDOZiN4NxgoqNpIqmqDa0El3xxVPm3y8VOgjYkGLfxrR5CNlfnjg8QF4HD5IkqyhpQZ80L3MaZVzLvLbh2M+T2UnS+HqnSnmJskGJeG7TPRtDg98E6QLf7z+USyj23XKzXaWE68V5ElpWF3OZikOxa10E1mxFAWRfy29SQogAGO2oE+GSV76M4ovwCKiBoOlMjOjPwa5z8Vg8YffTgCOKS0Me015V+Zyo97XkQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2016 01:59:19.2607 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 26/28] net/virtio: use eal I/O device memory read/write API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Dec 2016 01:59:25 -0000 From: Santosh Shukla Replace the raw I/O device memory read/write access with eal abstraction for I/O device memory read/write access to fix portability issues across different architectures. Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob CC: Huawei Xie CC: Yuanhan Liu --- drivers/net/virtio/virtio_pci.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index 9b47165..47c5a2e 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -41,6 +41,8 @@ #include "virtio_logs.h" #include "virtqueue.h" +#include + /* * Following macros are derived from linux/pci_regs.h, however, * we can't simply include that header here, as there is no such @@ -320,37 +322,37 @@ static const struct virtio_pci_ops legacy_ops = { static inline uint8_t io_read8(uint8_t *addr) { - return *(volatile uint8_t *)addr; + return rte_readb(addr); } static inline void io_write8(uint8_t val, uint8_t *addr) { - *(volatile uint8_t *)addr = val; + rte_writeb(val, addr); } static inline uint16_t io_read16(uint16_t *addr) { - return *(volatile uint16_t *)addr; + return rte_readw(addr); } static inline void io_write16(uint16_t val, uint16_t *addr) { - *(volatile uint16_t *)addr = val; + rte_writew(val, addr); } static inline uint32_t io_read32(uint32_t *addr) { - return *(volatile uint32_t *)addr; + return rte_readl(addr); } static inline void io_write32(uint32_t val, uint32_t *addr) { - *(volatile uint32_t *)addr = val; + rte_writel(val, addr); } static inline void -- 2.5.5