From mboxrd@z Thu Jan 1 00:00:00 1970 From: Santosh Shukla Subject: [ [PATCH v2] 05/13] virtio: change io_base datatype from uint32_t to uint64_type Date: Mon, 14 Dec 2015 18:30:24 +0530 Message-ID: <1450098032-21198-6-git-send-email-sshukla@mvista.com> References: <1450098032-21198-1-git-send-email-sshukla@mvista.com> To: dev@dpdk.org Return-path: Received: from mail-pf0-f176.google.com (mail-pf0-f176.google.com [209.85.192.176]) by dpdk.org (Postfix) with ESMTP id 622B38E93 for ; Mon, 14 Dec 2015 14:00:58 +0100 (CET) Received: by pff63 with SMTP id 63so11003646pff.2 for ; Mon, 14 Dec 2015 05:00:57 -0800 (PST) In-Reply-To: <1450098032-21198-1-git-send-email-sshukla@mvista.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In x86 case io_base to store ioport address not more than 65535 ioports. i.e..0 to ffff but in non-x86 case in particular arm64 it need to store more than 32 bit address so changing io_base datatype from 32 to 64. Signed-off-by: Santosh Shukla --- drivers/net/virtio/virtio_ethdev.c | 2 +- drivers/net/virtio/virtio_pci.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index d928339..620e0d4 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1291,7 +1291,7 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) return -1; hw->use_msix = virtio_has_msix(&pci_dev->addr); - hw->io_base = (uint32_t)(uintptr_t)pci_dev->mem_resource[0].addr; + hw->io_base = (uint64_t)(uintptr_t)pci_dev->mem_resource[0].addr; /* Reset the device although not necessary at startup */ vtpci_reset(hw); diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h index 3f4ff80..f3e4178 100644 --- a/drivers/net/virtio/virtio_pci.h +++ b/drivers/net/virtio/virtio_pci.h @@ -169,7 +169,7 @@ struct virtqueue; struct virtio_hw { struct virtqueue *cvq; - uint32_t io_base; + uint64_t io_base; uint32_t guest_features; uint32_t max_tx_queues; uint32_t max_rx_queues; @@ -231,7 +231,7 @@ outl_p(unsigned int data, unsigned int port) #endif #define VIRTIO_PCI_REG_ADDR(hw, reg) \ - (unsigned short)((hw)->io_base + (reg)) + (unsigned long)((hw)->io_base + (reg)) #define VIRTIO_READ_REG_1(hw, reg) \ inb((VIRTIO_PCI_REG_ADDR((hw), (reg)))) -- 1.7.9.5