From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0061.outbound.protection.outlook.com [104.47.42.61]) by dpdk.org (Postfix) with ESMTP id 54D55F957 for ; Tue, 17 Jan 2017 08:16:44 +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=EwhnjmGKuL1vUwcygDgowpW7dKT9xHRCYseu8SouSmudm6VjnJvHiGp07p19XbQNv2d66lNxk5B6GgNyE/Bncwzp165Vy4XFYSULH2LeT6HWqKpKfX60ee0+2ggdimqsBl1uPYk+HhhGHjLXZ8BvOvqRA8OxEj6Y+VzKbn9CGr8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.caveonetworks.com (111.93.218.67) by BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Tue, 17 Jan 2017 07:16:39 +0000 From: Jerin Jacob To: CC: , , , , , , Huawei Xie , Yuanhan Liu , Jerin Jacob Date: Tue, 17 Jan 2017 12:44:03 +0530 Message-ID: <1484637244-7548-29-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1484637244-7548-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484637244-7548-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: PN1PR01CA0030.INDPRD01.PROD.OUTLOOK.COM (10.164.137.37) To BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) X-MS-Office365-Filtering-Correlation-Id: 2c21ac32-9518-4cd2-2ad1-08d43ea8ca0b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 3:f8CZUELTKNNfrd6BF8o8rFApRBKsKsRqSZz0mQcwmT7JqV6H9xbkCUvsL+G5QvcR8aCo3ZtKyk6FttF70yJHk6nvLOa7Z7r1YAbn8LPjHEYlYI7SjfMshuE0nU7UD2EJMWmdpIXWQFAQZGU132aNShX0DLG+dIVOTAR9n4yTxlNdUm33nWwwQxZD7OAZgwmr3sRHJJua7XcHKmftkI1sHjeGlO/qSvJd99IiJsMicWR7rzetJ8hM4T1FHPqfnlPEHWvRVNVl7CsNUzkeq+/fow==; 25:DQG6Hlxv9s5qFgsXaXjI8R9sixcX5gSxDLaPJLtpucL/dt6Z3FljZt1cIZC4kPrp/GPqaEMdeBN5WsLbbtr63JnXTOoQFUqZG93CbE/LfmeT3U8E/Ceg4hDr5Zgm+yFU1+px/seGtKye4NLyxEgT0GdY245/qlJ3diIqJyyTB/TOQJuOJB29To9LWWTKKFD9qAewbFQxwzB95tIn+gH5z9O5wa8DA2F5DW/7nM65M6MX1n0sEdrINMwI1spNdJ4An8PClwv5LpaiCbNOZWtvz/9itiCpun00Y1LAAxya+P6zTmfa5GerGD6Jo6ViT94C/YyruT43WT1PX1NQBOJvgjIS1H5dh1uMe8PDO+6t9vGT6a2mOYjC5M7asp0lD9PS8Ar1h5sS7J72oSdlagCV/Gw+kS81OQRmHkla/F/iJ0WxEPlW7XPqacr87aaZZBksyTon0kDap0gRQ5eGIT3Lvg== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 31:og52JkKp2/WQo5ufcN2BNy3Zj2c/ofpU01d1kTavAZHASvxlDXUiqUJFbwpNw9VSlJ+WFKuTGsJOYNBfRYVUMnAw4ekmNP3V0BxIWzNVnJ1YphzWBbWAHteJNcrlDP2Ls0I1LioBJsI/IK5ECD9uKAg3v2lUlJ/Uzc1pvZRbxgqW4dC89ZRrxW3oThS6CVMKPgNcVJmIryhnxEfZXJM/7wf4aElauX9GHIFt2B2i/CLXOP0t5u7AukNdRytmuhFDnxv5M++Ez5phOfpjc8lkOw==; 20:M4xDSfXmFPTE49fFM5O5cVDGfH2jqvBMWxhK3sTxj9XIgfTTDOh4PJs5nG+1SaYjGi5LuucXmknV/AGZKrQ+2KEoeSweBugpxZeQ9G8hxes7SjHjUDX4fzbhWzjcAELptoA2VtFY83Iswni5AyZcNeuDCCeA620+/ODV02mSYNaMOwbumUkLWdRt3kmv7uA2VB2KXrXnm0K2V1T0aG7sinuvf5T8EsfqS4wqlHqQW4RsTa04MLFl6FLne/I2mTYC1S5EbSlLwG4A4O+D5WpwyFo4mLb4ubaOxi5QwOannW1e8gejDUYxaGgbfJGwdUrdD5k8oqqp8RSuw6xlc1jgGGoQeu7HqEu9g9I+1g8Om0yGPxYurTQSW3jR4RAqgNmuiqsDnuAmLF+qnqAeykhf7cqk5V+0eaqPFiU2Blt6RYDfuw+poTrExHeRU+TCmu/im4q/0d+s0TV+JjbbdWRBAGYr5KFdvJBD6hzQpijqbqIrzxBATL6ipvA9n7f89fHayPbZ+w8ZW/LztBxZaAjntqGfYfPbhu9SB1vzTRiPk48XzFiE3qsFRBxZ5Vpt9hPyralzDsYRahWY4wZY6serdzIcG7TDicHkTtNcOkucPAQ= 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)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:BY1PR0701MB1724; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 4:sOhiHtzi1Oh7zXskyLdRkXeUQzLgiCabf5+nC/vGX1rsasog7WEFOihArp/E6AoTg+gTu2Wg7SzJwzWZ3tV+7UOiFR6GqW9yrB+6jOHn8DpMxYnzP859pIPbSyLCOCpDqku8oz8u+IqsnbN6MIKVXwMlJAUMnVjs+wJ+fWNk0xUCzPdpHQCwodXfjihzomzFAE1kx5uJSxcbIQ99Jq+YUwqp8wNXLj7zwqeEwuDtG5ltRB0b+Wq6rD7aZ6bnRZajQC14IxkNW9hpaRLBODN7sn04A+tAEB7MyUaQlX7U+1JIv1kYwXsJtXXBxVos3OQcwqO25Z/Pubufvw+YbDbwJI7l9XskMsqWuNHXh7jbXyrTvDL4oVtvL0ObT/fYls5ujPWiO/sUi1Y5qHlBhVccur4iwRL103II4j7q18gZYpzBewntFneqt6qJbx2W6c78AU2jAml0ApCRFFI3cHzyulnO39Pqr6dqG2d50mc7W5Um3ky4i100oEHgz2rnfW+5bZLTmUbOKQ8xxYcXw5HmlvVTic/Syybd+jVOUHBFb60fC2Ab9zVJyjs4bccnzKQMn0GLFpC02BzOEtH605+NInjXj1F6wDyv+cr9ktW7ZoWFfvq0CbKntJyeQa9ks+IZMEelEPuy+yszBf6+VQ5W1Q== X-Forefront-PRVS: 01901B3451 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(199003)(189002)(2906002)(4326007)(76506005)(107886002)(53416004)(189998001)(92566002)(106356001)(38730400001)(47776003)(25786008)(6486002)(54906002)(66066001)(6506006)(305945005)(7736002)(6512007)(5009440100003)(81156014)(3846002)(50226002)(5003940100001)(68736007)(4001430100002)(6116002)(76176999)(50986999)(2351001)(97736004)(81166006)(5660300001)(8676002)(105586002)(69596002)(42186005)(48376002)(6666003)(36756003)(33646002)(101416001)(2950100002)(6916009)(110136003)(50466002)(42882006)(30001)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1724; H:localhost.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; BY1PR0701MB1724; 23:ABursPpoYckmNiqmpMS+/b03bd5qWmWB6P9RyfN?= =?us-ascii?Q?FccEpdAK8fPPdZo4erDzBcdvh3gBiuWS7yH6WmJJFNEfmw+fOPxWgmqVG1Zx?= =?us-ascii?Q?bRMmTevREv2ayMcal8nFP+too+6MhZMQiqEkHwjtu2ZtRS9Z1QAnZahDJMPh?= =?us-ascii?Q?v0kYuHzvsdsHzDx1vD/fTBIxguHSg7OESdE4c5h4VnqiX3AcYNHHbygWFZqr?= =?us-ascii?Q?Zm00rEUjmKqSeWSG1CDmgQKL9lqj0I0N9VUwQdkxJHAfW4skeM2/3i88Rg6c?= =?us-ascii?Q?wOTsDKHtMiMCGz+b7E4c3gMXXKR+kBcFi/Us5xSEyjgBiGja2DdqO5+CYC4T?= =?us-ascii?Q?3NWzU5oD115/F3GlRNcqsjNckvd9DHschmlvuDM4o4kAiL5uj+4qz9BqVENE?= =?us-ascii?Q?PCxiWPhlH/0vH1NGXYlsdB2xjK1c1PMhp/5uKJG3c+hZUhppqylQbwNf03rk?= =?us-ascii?Q?wsIAx3TtAgKW7jksyXsyGbAbrTzLTFTZVDLLgioND4p0uEBoy3d+e6Ti0/ZJ?= =?us-ascii?Q?O9xZJ/nkiAC0u6Ok+7goAPm5qSFAuEz391OajO0xz+gnBtdgn9/aJrae9A3v?= =?us-ascii?Q?iUou7P6dezX5xMNKvcPiSProijuMoQbFicL5R/LZasX4t94Qv9uQtrMQc+ub?= =?us-ascii?Q?U9oGk8j9treHOSd8aPeNbm6FIVr/xwvsRZMSYfw22f+NQIukHBMuPZGcpqdT?= =?us-ascii?Q?c/DHzqxJxIQsAE4OBUtZy7TZQvwi+lCHmoy4tciE7pyQ+VtzTD/5uURTqNDu?= =?us-ascii?Q?e8lSlljW/+li+pseFHfihdNtPmet4zoS5VxaLFpmm5gz4UMDwQ069ILw+rM8?= =?us-ascii?Q?BfXhtz1j6F95mTd1WuPqHhx6xAaFNte5HslElKP39ieT2/TgUFK3VzHenYzK?= =?us-ascii?Q?d1woaz1UN1Y7FJ7Ayas9GruG+wdc34SYSxpoYRqa0zTeqwyrMNPSq4NMykeH?= =?us-ascii?Q?4GKZp27iiHMcULYUnNOUlRNJ+HWRdDO+o4Ct0fjjeRUnu4T48crWSe+ofpi+?= =?us-ascii?Q?dWqHXFHq0x5eW3k/6M04kz8yLyEdLK2P9QGoKea4cf16rTpdJYdWvacwvp6X?= =?us-ascii?Q?BqFPb3wKpTO5MWSBYLcQnCkhJoKDmmE8PV7nEaO7wTJDJ9XVfBAlXB0KC0rZ?= =?us-ascii?Q?lCfCmjadyWeZYTYJqJPBqahZVTXxWYt+x4qQe7DixpL/50lEQL70T5EJBVfS?= =?us-ascii?Q?ssmh0z4vq2J3OfGIEEChC3ZX6R9R6s8ZcMD9wRrbduMfP+PneRIwzVkYyTY1?= =?us-ascii?Q?0KnE6uruB2AaXjl48MTRIKGzkTqvCYRw7CRSO6rePfK+EEMnN+ljZ7WjrP//?= =?us-ascii?Q?7HrvqWoBXCrQxx04OrTrgEKY=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 6:2TfmMnND36xzSGJg8//ttgj/yoyo9SJWgMvbH9S0tAzPYuxOWOMLKGPM34Z2WTJUx83mVjeH86JitsXM6ESkNmNwO3npP1jZMcK6YeBS7uzhAsEoenB+3psbq/waMlqE78lSO53CjwWj5cRyQXCV3NyQu2kB+13rV1wgk2qbpAjcP52tHSDA9+BE+6hmWwFpHvT08OmFVXd1nmENQeNi9pw9BPREri4NDViQ4crDugH5PFcDZH7kb+xY0gAv7hMgrDSLcW0G+CibljGRGrIzSYgPCTa4iGCBwUuhI8A8H3+hR6yabmesDpndSe2Wv8nh0DgPU1KKBqgRpAwcavhJ9BhBdUhP8xeFqQpT/sizD8GJfE+KGi5THOK32DBkGdJC5ssjRTbc5Hf22tPR53dS2UWbrJY0DgdtrwmKdCAaId4=; 5:D/XMPwNfhkmtynRo7z4K5ZPkQaCJSxWnliM6FVwmDwa/8Qs46zOYPkSijaawx1yQHuLmyjPitdt8jZZoPWJSDYkvDQnomXxOjBaBGEuLXLlR19iSM+mCX8ziohO/AUWzHZ2twhOZf3iqkMH8qe2ODQ==; 24:0sK10EniZ5vdU30GKQnRxAq8rm/pwfPhBmChj1i+d6nUml36gxpkYCqjqDUZBT6xQtNCcaNwMFcGcOjOyCAf5UKCPjg6Q2WxPy/51MTZGcM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 7:BbzT+5QRgjzxJkD5smp4fSoe64JLk/ZmP/f1ZlReQUeGOEG0KA9xPqC48mAG58PIwU2/DhU3O2FveVJNvlzkyYg1Tg8TXqp1S05y8OnfkeWX72zw+WaJd9yFZZhAt3TE+TXrvcyr/XH6fFWmojBhZG0S6MlhNGzFc3aUsFhL8lXzThqjBaLblxXeckxKGE4wqMYYp63DF++9aF5x8J/YkkPB7slA5GIG1zdQfYadG/OyWAcWt4WEbasehZglSiGb0UGihrHIMjNMJPjO1D7a6Bu66qvWd2AYU3Khd0i469qqRga8+UArCJAaP/TO7Nj1UvvVUpwF+qKGWmkOs3nZdm7XkJAnSNfEKebE5Et7Sl2knZ2kqcvGAsH3DiQV615yNzvBuYN1grck9z+7Tmy7DBjuFCNHeEo9oyWQi2kHM08ss3kLC4gWhliw/20P1UX/SnPux11FuD3XETRtqfEvhQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2017 07:16:39.5741 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1724 Subject: [dpdk-dev] [PATCH v4 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: Tue, 17 Jan 2017 07:16:44 -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