From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id EE6A4C33C for ; Fri, 5 Feb 2016 18:55:50 +0100 (CET) Received: by mail-wm0-f49.google.com with SMTP id p63so37363321wmp.1 for ; Fri, 05 Feb 2016 09:55:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=4ChCSCp9IdNTlPMpSwNDWzt5p1v1do1y+pBGf7Akggo=; b=VMClIK58hHYCiB92Z7S/X10wRc/CogJI2LWGtLD50s1fwT04vDm6GnaP7DQtmW++pH BI/tqpCXfZNadsVPof7JUObcMiwUPOwpy9YXnX2Z9tS8GbWt+WBVBT/EceXbxQ/gQsc+ h4XNRpknQnHrFa0n+ixN1fJBDvNnIui85PFmm9c08pmUpka1ANs5NtTxfXPmVip2+Km4 hQO07+75DtsWraQrhTWPbHxqqV44dZJdVexkUy3TSBVgWoGy5vsGMiVYJyCQdb1mhop3 RCOsrzqTd80rni6tgnujCBQ7soOrV5KziKtDWjI4DGIBcgw9gvlufPUM4ejPkN+nP1iB 9zLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4ChCSCp9IdNTlPMpSwNDWzt5p1v1do1y+pBGf7Akggo=; b=DutiU7bSVmLuEPhQLRZ7MOZGec8T4FHmUJAyI8J1s8xLNdr/e0SnIkS+qdLqtEx/tr GHgBvK8ai7JZQMM2gZkfci56OyjYbkXB36oI/OipoMgDPS/CTmgx1Rt1SbSNVfnX7HFB zdGWdyyIL3KRn3mEVBVgE8QcoqieH3lFRJF1AwAZU1m3oCXtDe8CsY+c4Dgtu6/t1swW JmKQzHOL+LcTS+6nNIm5nQc6CdQxAZxJs5hImeUvwkyZKKguZxCXjXfnPlJ0xw63A5P0 HAC+EtGmzraUc5/OckhPGiDI8ETOib4YyWKVduHd5MCJJ4jxq/opFR1le2F6HddKioGN K+2A== X-Gm-Message-State: AG10YOQzSKSG/gI5/OccbcG/ry21p9WdkWO3KJo5uWo3nMQqm+GJJvOWGp8Xal1BPOMzwJ/y X-Received: by 10.194.82.199 with SMTP id k7mr17145720wjy.65.1454694950776; Fri, 05 Feb 2016 09:55:50 -0800 (PST) Received: from gloops.dev.6wind.com (144.77.126.78.rev.sfr.net. [78.126.77.144]) by smtp.gmail.com with ESMTPSA id gt7sm16942517wjc.1.2016.02.05.09.55.49 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 05 Feb 2016 09:55:50 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Fri, 5 Feb 2016 18:55:41 +0100 Message-Id: <1454694945-18040-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH 0/4] rework ioport access for virtio 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: Fri, 05 Feb 2016 17:55:51 -0000 Introduce a new ioport api in eal to mask all arch / kernel driver specifics. - rte_eal_pci_ioport_map is responsible for initialising an rte_pci_ioport object that is used in subsequent calls, this function must be tweaked per architecture and per kernel driver, rte_ioport_t type is architecture specific and is used to hide those details to the application, - rte_eal_pci_ioport_read / rte_eal_pci_ioport_write uses a rte_pci_ioport object to read / write those resources, - rte_eal_pci_ioport_unmap releases resources used by a rte_pci_ioport object if necessary. There is still some more work to ensure intr handle are properly initialized and released when used in conjonction with rte_eal_map_device() api calls. For now, only x86 uio / "none" is supported, rte_ioport x86 code has been excessively simplified to only handle those cases at the moment. Other archs might want to support both uio / vfio / xxx. BSD code has been neither run nor compiled, please can someone confirm I did not break too much stuff ? virtio legacy code has been updated accordingly. With this, virtio code should be ready for other archs now. So in the end, all that is missing for ARM on linux is some vfio update and implementation of rte_ioport stuff. Regards, -- David Marchand David Marchand (4): virtio/bsd: fix typo virtio: fix incorrect check when mapping pci resources eal: introduce ioport api virtio: use ioport api drivers/net/virtio/virtio_pci.c | 343 ++++----------------- drivers/net/virtio/virtio_pci.h | 38 +-- lib/librte_eal/bsdapp/eal/eal_pci.c | 76 +++++ lib/librte_eal/bsdapp/eal/rte_eal_version.map | 4 + .../common/include/arch/arm/rte_ioport.h | 41 +++ .../common/include/arch/ppc_64/rte_ioport.h | 41 +++ .../common/include/arch/tile/rte_ioport.h | 41 +++ .../common/include/arch/x86/rte_ioport.h | 109 +++++++ lib/librte_eal/common/include/rte_pci.h | 68 ++++ lib/librte_eal/linuxapp/eal/eal_pci.c | 156 ++++++++++ lib/librte_eal/linuxapp/eal/eal_pci_init.h | 6 + lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 67 +++- lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 17 + lib/librte_eal/linuxapp/eal/rte_eal_version.map | 4 + 14 files changed, 684 insertions(+), 327 deletions(-) create mode 100644 lib/librte_eal/common/include/arch/arm/rte_ioport.h create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_ioport.h create mode 100644 lib/librte_eal/common/include/arch/tile/rte_ioport.h create mode 100644 lib/librte_eal/common/include/arch/x86/rte_ioport.h -- 1.9.1