From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0075.outbound.protection.outlook.com [104.47.42.75]) by dpdk.org (Postfix) with ESMTP id AAE50F95B for ; Thu, 12 Jan 2017 10:20:56 +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=fsY1ZvEHOEyON71oHSwjNwIKaz9kMI0kr7qFxZojul8=; b=LJjo0uo5eXzCnWczF2VpFV2hPJkwD5Ig/6XwIqETwccbvhwrsWtBAY2nTPKygOItffdBgA/zozNMKFNa3AgqL/iSE9JyPIhY46/fou5qFF3acJLyLiyGnIouOE/Tc+Wy/bpoHCOaPRdf8DhSGvnNWr7dKnOv8rkG8MI6Fzqk7Ow= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.caveonetworks.com (111.93.218.67) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Thu, 12 Jan 2017 09:20:50 +0000 From: Jerin Jacob To: CC: , , , , , , Huawei Xie , Yuanhan Liu , Jerin Jacob Date: Thu, 12 Jan 2017 14:47:25 +0530 Message-ID: <1484212646-10338-29-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1482832175-27199-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BY2PR06CA0007.namprd06.prod.outlook.com (10.166.106.145) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-Office365-Filtering-Correlation-Id: 37a6db25-f329-4e04-672c-08d43acc4f42 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:yHK2sOM/Iy7c1j5qR6X73gbh9ICIXOqoX1gDEpZfNIxWNXv1Po52CFniDjmcfJ/P8AF2LPNzNMfSfLSKJRrhkNag+sHFEHhax8u4uQQIzFcQ/JIwujAtUiCSmpW6rXqCQKuxs1YWxOXYksGyycR7dDPnwJDejrpz3OaAOtr2fdsn9n1ZicPOXGK1Om2KW4TSstKlmVZ5B41FDQPetZompwApXNCAyKjIk40OOpIdXj9pCY161sDp8/lAP54veCXrJ1v1azui6qsvJJdpUgLO8w== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 25:V3MuSt/mNPaGKgmKRRLzy7Ov554MDFl+VXsLLvzGDWEwp21rIkr60heH5jq4ThSe29SzzXByigUCF/y2YIVM8DW1RofD6zMzDk5hL1PuwLzKp6dgpAmMqPyaCPbfORAmpUCJqvNWicD7+VWD5bGGgfSaL48CYMCxwWm2F7ozr54cJUuO5QsiJau3FNAhU1LMH/1HABa5QAxJvX3Stev9N5iVKEeb9XfX5Jaf00dWCd+cW44xsof2wuWErvKoVCkPN9URCFZR2OY1mtRJZ8wmFqKaOiEJKtjk40c4rMmw5DRc+U6vIO9aNlEmcXA3wWBlGS7WWNKQzZ9DmeyNx10Kvu0UN3CsVeT5LHbTIW+iy5Dcm2w9al8HyCPOyX3Nk0lO3bwU6Qb6yRjyQCH9OFJYPte+nlmINJ7p2eY5CZBJjZ1qmvJgtnu+gfhpyN7CYoeRCowUmsgBfQ/i4JNy5I7pDPfbGfXeY3CgakGUsWwtQ1c14XDhEhb/Iw6j1DRF+1LL2jWYErDp3+xfAqSxB/0meSeK3JwASvqEJd2WN8M2GtlueI/19iGivvMqwi0i9zoMN+dzOrotoqr3Sk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4wT2aSp8FxwRvDRoAC8s8Zi5Xv5ylYK5hABxmIYZ55IUbUi42ouzasvDmcW2fF9vXSuWftGDdK1M1wrLkYE5rE/aElarbN9MU= 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)(3002001)(10201501046)(6041248)(20161123562025)(20161123560025)(20161123564025)(20161123555025)(6072148); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:PLhP+ru7i6obbhernAYUIxSyNytL33c3D610OXJjSODa/fWYaLZcie3VYTsPwBKvexQpkO+AHBLDmahDy0eNOhZUjlKUwr92Vp5IEfruTsb7rL/qAe+ZsDE+95tn53BHoPPsvn8FEDRR/67E6Ff8drAVyz8y6vXCmDAMBhyCF8Vd4jiIxyF6V3T8biwQH0AgQVFq1pfQ5rNEzhMLBtbVuhGV1I+9+KMbVZpRhAhskq+ZtBIYNBZg5lCQG9M62c+f4ImWFehixiouEjMP6j6PKwWLuvAl6scFKi35RZc1Ln1PulnOrsYn4bAS2AbUn37qXWmmoq4bNb+NrUfGPvcqmk9ftiB0bvmvF6QlLiypecdjTAJFzexKLrEnkr9XdJ0Pivtugu2YgCTMunebxTur0VqQfC4quS1L7Mee+PqFMseIFhed2zgfGTRpJS1TNAG3BnEoB+yGzToyXaVFgo2S2ziAUYRqH2qlYBxyuqqkrxFg/WWaFewUwgn4DZJ6iu7mijsJgIziVygMJ3lSN6mUFc9/U/yWdgRIXmv4d0uOHfSluQmxdo8lj9pQbyaFVml5uDV0ZNLSX+PAFBjxLGvcxXGUcz0DYGVUXCa4+mV0cXcZq4YMvHzelDdyLfQb48QmsBM8Ub0xGevHv1P/Oone9Q== X-Forefront-PRVS: 018577E36E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(189002)(199003)(2950100002)(53416004)(76506005)(92566002)(105586002)(69596002)(2351001)(42186005)(68736007)(106356001)(42882006)(6916009)(305945005)(2906002)(7736002)(50466002)(48376002)(36756003)(5660300001)(110136003)(4326007)(97736004)(107886002)(189998001)(50226002)(6666003)(6506006)(38730400001)(101416001)(54906002)(33646002)(5009440100003)(4001430100002)(6486002)(66066001)(5003940100001)(6116002)(3846002)(47776003)(25786008)(81166006)(6512007)(81156014)(76176999)(50986999)(8676002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:localhost.caveonetworks.com; 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; BLUPR0701MB1714; 23:DDnFBBXMHdlIjGlyUg1E4R2xB4tjnizWV5SvYCG?= =?us-ascii?Q?ueV9A6Te1sFkHNTv2nW2SdJQCUwxz1PHn8sRe5aJvuo4n7G7GC7qq961fgn8?= =?us-ascii?Q?bgKGpBNxiXRxdaB60fNwgIFCAcyVzlW1JJrLWOKPRiJPeTLKKAS5bL9fWs2Z?= =?us-ascii?Q?rqnSEDS9vgCVq/ZvGa9x1CnBBIS8XSBjxWO9/khtL1Xnn3mtpgHc/hvPJJiM?= =?us-ascii?Q?2ujeC+5l1IN6JUgEV9ApzCpYCZ5W4MZHpj/y2YgKLiRu7ixn+veFiiC2jwi5?= =?us-ascii?Q?PrCuc8R9W8SQvAcUL2Xs1MyBJxN0Pta2J1pdG5CN+MME7bZDm188NcQ1rLXE?= =?us-ascii?Q?MMhxaJVYNxBF0NQvd+zv2y5YZNTAaKvwTZ3ZIjO5tW5xzGx1HK6saEaUHVPa?= =?us-ascii?Q?6UXSQokRjKAW4HTFeCAuNNA7CKjjUVj1gM7/YCFmMoNo33yZgFXSYg6dPR3p?= =?us-ascii?Q?lHHpRX7pIw2UBBeINi+IEK6jM1aNsDzwYDbINNAEr+U/NMYwdsjzplj/doT1?= =?us-ascii?Q?7ijqzeXCGBmrMmqssgVHEbu7nrFfkYNZ/1fzI/3qQ8+ZoZL7V2MZZh6V8aO3?= =?us-ascii?Q?VySJuYQ/5mv4kwvdxn0iz97NT4J1E/DbdIR5dnR97SuIJKdfbNLKSJJHfvqb?= =?us-ascii?Q?II93uBOWM/gGA8whb/g1gNybe+fo8b8TjgUzSeQoBpMEBcjsjbCYGlvO8xpH?= =?us-ascii?Q?8LF8n5ahtI1pSKQJYuWf/fFqMz676CsOySuae9wKGtpd7qlqYA6oP0EHi71e?= =?us-ascii?Q?uaGWL87J8zlEkmDI+Aj2Cm9nOI0YsEndAY1Dkf5wA9n2d3holLWpiaW6cHsd?= =?us-ascii?Q?367YPwpSvxkmcP2cU0LyK59/0VqtsbAzLA9Vza7iJZuCmn/7JISVFJWp6ZTM?= =?us-ascii?Q?3kV+drr34mkG7ukACxcyCCp0oeczH0AGunrDcFj5ype+XatKpT21x2rjK836?= =?us-ascii?Q?evBSxu0/BpYg8hqbaR6CaSJWmxIzVc5Y2pYUkr7Hb2lCmDmi1wWd5marLSz7?= =?us-ascii?Q?aCWyex0TJVEYa5g6rYPM6KHKxtSZWj9g+QozlAJfEnZCpirK4d2/TigOZOAl?= =?us-ascii?Q?qoQ32la/9vmH1fSC5iU5HRNjXvZhAmyISzm2wdSMw6zrZFgHvs4WkgDuo8Ji?= =?us-ascii?Q?3v0QlETodVqiKq5qJw10C96WXK1ZdBxqyO8zxEbH7GwpHvh5S6XHXUQsqXqf?= =?us-ascii?Q?sRHRv0V2d12wvIdj0fIoOL84cd7s15o/yhIOOZUBpD7msIaTaMknaNs6y9YT?= =?us-ascii?Q?OyeE9k/7lOSyyupdZreJeo/CUHeCV6YTopFg4EsmrazXmE90ohWGVoictxpB?= =?us-ascii?Q?LQOWJm9KER30tF9Pc/kMNJTg=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLU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NR4rC0JmgT2nkKFCV7TWDsGjev19vb/vkTGHcNdUic0s0TFfuul2RES2ukwMHgEjmZe5iSyjuxa50zwJbJcpbbFsB6rUhMrPSvY2est2TqfhDmsK50lS9BlofJf0G5O3wIwUcpM9Dh68jiDleJijOE5kJe+pddoQEmC9otZua7V5gcaQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2017 09:20:50.1662 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH v3 28/29] 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: Thu, 12 Jan 2017 09:20:57 -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. CC: Huawei Xie CC: Yuanhan Liu Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob Acked-by: Yuanhan Liu --- drivers/net/virtio/virtio_pci.c | 97 +++++++++++++---------------------------- 1 file changed, 31 insertions(+), 66 deletions(-) diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index 9b47165..7c1cb4c 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -37,6 +37,8 @@ #include #endif +#include + #include "virtio_pci.h" #include "virtio_logs.h" #include "virtqueue.h" @@ -316,48 +318,11 @@ static const struct virtio_pci_ops legacy_ops = { .notify_queue = legacy_notify_queue, }; - -static inline uint8_t -io_read8(uint8_t *addr) -{ - return *(volatile uint8_t *)addr; -} - -static inline void -io_write8(uint8_t val, uint8_t *addr) -{ - *(volatile uint8_t *)addr = val; -} - -static inline uint16_t -io_read16(uint16_t *addr) -{ - return *(volatile uint16_t *)addr; -} - -static inline void -io_write16(uint16_t val, uint16_t *addr) -{ - *(volatile uint16_t *)addr = val; -} - -static inline uint32_t -io_read32(uint32_t *addr) -{ - return *(volatile uint32_t *)addr; -} - -static inline void -io_write32(uint32_t val, uint32_t *addr) -{ - *(volatile uint32_t *)addr = val; -} - static inline void io_write64_twopart(uint64_t val, uint32_t *lo, uint32_t *hi) { - io_write32(val & ((1ULL << 32) - 1), lo); - io_write32(val >> 32, hi); + rte_write32(val & ((1ULL << 32) - 1), lo); + rte_write32(val >> 32, hi); } static void @@ -369,13 +334,13 @@ modern_read_dev_config(struct virtio_hw *hw, size_t offset, uint8_t old_gen, new_gen; do { - old_gen = io_read8(&hw->common_cfg->config_generation); + old_gen = rte_read8(&hw->common_cfg->config_generation); p = dst; for (i = 0; i < length; i++) - *p++ = io_read8((uint8_t *)hw->dev_cfg + offset + i); + *p++ = rte_read8((uint8_t *)hw->dev_cfg + offset + i); - new_gen = io_read8(&hw->common_cfg->config_generation); + new_gen = rte_read8(&hw->common_cfg->config_generation); } while (old_gen != new_gen); } @@ -387,7 +352,7 @@ modern_write_dev_config(struct virtio_hw *hw, size_t offset, const uint8_t *p = src; for (i = 0; i < length; i++) - io_write8(*p++, (uint8_t *)hw->dev_cfg + offset + i); + rte_write8((*p++), (((uint8_t *)hw->dev_cfg) + offset + i)); } static uint64_t @@ -395,11 +360,11 @@ modern_get_features(struct virtio_hw *hw) { uint32_t features_lo, features_hi; - io_write32(0, &hw->common_cfg->device_feature_select); - features_lo = io_read32(&hw->common_cfg->device_feature); + rte_write32(0, &hw->common_cfg->device_feature_select); + features_lo = rte_read32(&hw->common_cfg->device_feature); - io_write32(1, &hw->common_cfg->device_feature_select); - features_hi = io_read32(&hw->common_cfg->device_feature); + rte_write32(1, &hw->common_cfg->device_feature_select); + features_hi = rte_read32(&hw->common_cfg->device_feature); return ((uint64_t)features_hi << 32) | features_lo; } @@ -407,25 +372,25 @@ modern_get_features(struct virtio_hw *hw) static void modern_set_features(struct virtio_hw *hw, uint64_t features) { - io_write32(0, &hw->common_cfg->guest_feature_select); - io_write32(features & ((1ULL << 32) - 1), - &hw->common_cfg->guest_feature); + rte_write32(0, &hw->common_cfg->guest_feature_select); + rte_write32(features & ((1ULL << 32) - 1), + &hw->common_cfg->guest_feature); - io_write32(1, &hw->common_cfg->guest_feature_select); - io_write32(features >> 32, - &hw->common_cfg->guest_feature); + rte_write32(1, &hw->common_cfg->guest_feature_select); + rte_write32(features >> 32, + &hw->common_cfg->guest_feature); } static uint8_t modern_get_status(struct virtio_hw *hw) { - return io_read8(&hw->common_cfg->device_status); + return rte_read8(&hw->common_cfg->device_status); } static void modern_set_status(struct virtio_hw *hw, uint8_t status) { - io_write8(status, &hw->common_cfg->device_status); + rte_write8(status, &hw->common_cfg->device_status); } static void @@ -438,21 +403,21 @@ modern_reset(struct virtio_hw *hw) static uint8_t modern_get_isr(struct virtio_hw *hw) { - return io_read8(hw->isr); + return rte_read8(hw->isr); } static uint16_t modern_set_config_irq(struct virtio_hw *hw, uint16_t vec) { - io_write16(vec, &hw->common_cfg->msix_config); - return io_read16(&hw->common_cfg->msix_config); + rte_write16(vec, &hw->common_cfg->msix_config); + return rte_read16(&hw->common_cfg->msix_config); } static uint16_t modern_get_queue_num(struct virtio_hw *hw, uint16_t queue_id) { - io_write16(queue_id, &hw->common_cfg->queue_select); - return io_read16(&hw->common_cfg->queue_size); + rte_write16(queue_id, &hw->common_cfg->queue_select); + return rte_read16(&hw->common_cfg->queue_size); } static int @@ -470,7 +435,7 @@ modern_setup_queue(struct virtio_hw *hw, struct virtqueue *vq) ring[vq->vq_nentries]), VIRTIO_PCI_VRING_ALIGN); - io_write16(vq->vq_queue_index, &hw->common_cfg->queue_select); + rte_write16(vq->vq_queue_index, &hw->common_cfg->queue_select); io_write64_twopart(desc_addr, &hw->common_cfg->queue_desc_lo, &hw->common_cfg->queue_desc_hi); @@ -479,11 +444,11 @@ modern_setup_queue(struct virtio_hw *hw, struct virtqueue *vq) io_write64_twopart(used_addr, &hw->common_cfg->queue_used_lo, &hw->common_cfg->queue_used_hi); - notify_off = io_read16(&hw->common_cfg->queue_notify_off); + notify_off = rte_read16(&hw->common_cfg->queue_notify_off); vq->notify_addr = (void *)((uint8_t *)hw->notify_base + notify_off * hw->notify_off_multiplier); - io_write16(1, &hw->common_cfg->queue_enable); + rte_write16(1, &hw->common_cfg->queue_enable); PMD_INIT_LOG(DEBUG, "queue %u addresses:", vq->vq_queue_index); PMD_INIT_LOG(DEBUG, "\t desc_addr: %" PRIx64, desc_addr); @@ -498,7 +463,7 @@ modern_setup_queue(struct virtio_hw *hw, struct virtqueue *vq) static void modern_del_queue(struct virtio_hw *hw, struct virtqueue *vq) { - io_write16(vq->vq_queue_index, &hw->common_cfg->queue_select); + rte_write16(vq->vq_queue_index, &hw->common_cfg->queue_select); io_write64_twopart(0, &hw->common_cfg->queue_desc_lo, &hw->common_cfg->queue_desc_hi); @@ -507,13 +472,13 @@ modern_del_queue(struct virtio_hw *hw, struct virtqueue *vq) io_write64_twopart(0, &hw->common_cfg->queue_used_lo, &hw->common_cfg->queue_used_hi); - io_write16(0, &hw->common_cfg->queue_enable); + rte_write16(0, &hw->common_cfg->queue_enable); } static void modern_notify_queue(struct virtio_hw *hw __rte_unused, struct virtqueue *vq) { - io_write16(1, vq->notify_addr); + rte_write16(1, vq->notify_addr); } static const struct virtio_pci_ops modern_ops = { -- 2.5.5