get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/28086/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 28086,
    "url": "https://patches.dpdk.org/api/patches/28086/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1504116634-115687-3-git-send-email-jianfeng.tan@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1504116634-115687-3-git-send-email-jianfeng.tan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1504116634-115687-3-git-send-email-jianfeng.tan@intel.com",
    "date": "2017-08-30T18:10:30",
    "name": "[dpdk-dev,2/6] net/xenvirt: remove",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2840413047325e79eb129bc4f47a8e09ac8a59b6",
    "submitter": {
        "id": 313,
        "url": "https://patches.dpdk.org/api/people/313/?format=api",
        "name": "Jianfeng Tan",
        "email": "jianfeng.tan@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1504116634-115687-3-git-send-email-jianfeng.tan@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/28086/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/28086/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id A22803255;\n\tWed, 30 Aug 2017 20:09:48 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id 2AF8D2C17\n\tfor <dev@dpdk.org>; Wed, 30 Aug 2017 20:09:45 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga105.jf.intel.com with ESMTP; 30 Aug 2017 11:09:44 -0700",
            "from dpdk06.sh.intel.com ([10.67.110.196])\n\tby orsmga002.jf.intel.com with ESMTP; 30 Aug 2017 11:09:42 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.41,449,1498546800\"; d=\"scan'208\";a=\"130029476\"",
        "From": "Jianfeng Tan <jianfeng.tan@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "xen-devel@lists.xenproject.org, thomas@monjalon.net,\n\tjohn.mcnamara@intel.com, oao.m.martins@oracle.com,\n\tjerin.jacob@caviumnetworks.com, shahafs@mellanox.com,\n\tJianfeng Tan <jianfeng.tan@intel.com>",
        "Date": "Wed, 30 Aug 2017 18:10:30 +0000",
        "Message-Id": "<1504116634-115687-3-git-send-email-jianfeng.tan@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1504116634-115687-1-git-send-email-jianfeng.tan@intel.com>",
        "References": "<1504116634-115687-1-git-send-email-jianfeng.tan@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 2/6] net/xenvirt: remove",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>\n---\n MAINTAINERS                                     |   2 -\n app/test-pmd/Makefile                           |   4 -\n app/test-pmd/testpmd.c                          |  12 -\n config/common_base                              |   5 -\n config/defconfig_arm-armv7a-linuxapp-gcc        |   1 -\n doc/guides/nics/features/xenvirt.ini            |   6 -\n drivers/net/Makefile                            |   2 -\n drivers/net/xenvirt/Makefile                    |  57 --\n drivers/net/xenvirt/rte_eth_xenvirt.c           | 766 ------------------------\n drivers/net/xenvirt/rte_eth_xenvirt.h           |  61 --\n drivers/net/xenvirt/rte_eth_xenvirt_version.map |   7 -\n drivers/net/xenvirt/rte_mempool_gntalloc.c      | 295 ---------\n drivers/net/xenvirt/rte_xen_lib.c               | 454 --------------\n drivers/net/xenvirt/rte_xen_lib.h               | 116 ----\n drivers/net/xenvirt/virtio_logs.h               |  70 ---\n drivers/net/xenvirt/virtqueue.h                 | 273 ---------\n mk/rte.app.mk                                   |   1 -\n pkg/dpdk.spec                                   |   3 -\n 18 files changed, 2135 deletions(-)\n delete mode 100644 doc/guides/nics/features/xenvirt.ini\n delete mode 100644 drivers/net/xenvirt/Makefile\n delete mode 100644 drivers/net/xenvirt/rte_eth_xenvirt.c\n delete mode 100644 drivers/net/xenvirt/rte_eth_xenvirt.h\n delete mode 100644 drivers/net/xenvirt/rte_eth_xenvirt_version.map\n delete mode 100644 drivers/net/xenvirt/rte_mempool_gntalloc.c\n delete mode 100644 drivers/net/xenvirt/rte_xen_lib.c\n delete mode 100644 drivers/net/xenvirt/rte_xen_lib.h\n delete mode 100644 drivers/net/xenvirt/virtio_logs.h\n delete mode 100644 drivers/net/xenvirt/virtqueue.h",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex fe6c6db..003e72e 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -194,9 +194,7 @@ M: Jianfeng Tan <jianfeng.tan@intel.com>\n F: lib/librte_eal/linuxapp/xen_dom0/\n F: lib/librte_eal/linuxapp/eal/*xen*\n F: lib/librte_eal/linuxapp/eal/include/exec-env/rte_dom0_common.h\n-F: drivers/net/xenvirt/\n F: doc/guides/xen/\n-F: doc/guides/nics/features/xenvirt.ini\n \n FreeBSD EAL (with overlaps)\n M: Bruce Richardson <bruce.richardson@intel.com>\ndiff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile\nindex c36be19..b6e80dd 100644\n--- a/app/test-pmd/Makefile\n+++ b/app/test-pmd/Makefile\n@@ -77,10 +77,6 @@ ifeq ($(CONFIG_RTE_LIBRTE_BNXT_PMD),y)\n LDLIBS += -lrte_pmd_bnxt\n endif\n \n-ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y)\n-LDLIBS += -lrte_pmd_xenvirt\n-endif\n-\n endif\n \n CFLAGS_cmdline.o := -D_GNU_SOURCE\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex 7d40139..f8d02ae 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -76,9 +76,6 @@\n #ifdef RTE_LIBRTE_IXGBE_PMD\n #include <rte_pmd_ixgbe.h>\n #endif\n-#ifdef RTE_LIBRTE_PMD_XENVIRT\n-#include <rte_eth_xenvirt.h>\n-#endif\n #ifdef RTE_LIBRTE_PDUMP\n #include <rte_pdump.h>\n #endif\n@@ -497,15 +494,6 @@ mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf,\n \t\t\"create a new mbuf pool <%s>: n=%u, size=%u, socket=%u\\n\",\n \t\tpool_name, nb_mbuf, mbuf_seg_size, socket_id);\n \n-#ifdef RTE_LIBRTE_PMD_XENVIRT\n-\trte_mp = rte_mempool_gntalloc_create(pool_name, nb_mbuf, mb_size,\n-\t\t(unsigned) mb_mempool_cache,\n-\t\tsizeof(struct rte_pktmbuf_pool_private),\n-\t\trte_pktmbuf_pool_init, NULL,\n-\t\trte_pktmbuf_init, NULL,\n-\t\tsocket_id, 0);\n-#endif\n-\n \t/* if the former XEN allocation failed fall back to normal allocation */\n \tif (rte_mp == NULL) {\n \t\tif (mp_anon != 0) {\ndiff --git a/config/common_base b/config/common_base\nindex 5e97a08..93928b6 100644\n--- a/config/common_base\n+++ b/config/common_base\n@@ -411,11 +411,6 @@ CONFIG_RTE_LIBRTE_AVP_DEBUG_BUFFERS=n\n CONFIG_RTE_LIBRTE_PMD_TAP=n\n \n #\n-# Compile Xen PMD\n-#\n-CONFIG_RTE_LIBRTE_PMD_XENVIRT=n\n-\n-#\n # Compile null PMD\n #\n CONFIG_RTE_LIBRTE_PMD_NULL=y\ndiff --git a/config/defconfig_arm-armv7a-linuxapp-gcc b/config/defconfig_arm-armv7a-linuxapp-gcc\nindex 00bc2ab..6628567 100644\n--- a/config/defconfig_arm-armv7a-linuxapp-gcc\n+++ b/config/defconfig_arm-armv7a-linuxapp-gcc\n@@ -76,7 +76,6 @@ CONFIG_RTE_LIBRTE_I40E_PMD=n\n CONFIG_RTE_LIBRTE_IXGBE_PMD=n\n CONFIG_RTE_LIBRTE_MLX4_PMD=n\n CONFIG_RTE_LIBRTE_VMXNET3_PMD=n\n-CONFIG_RTE_LIBRTE_PMD_XENVIRT=n\n CONFIG_RTE_LIBRTE_PMD_BNX2X=n\n CONFIG_RTE_LIBRTE_QEDE_PMD=n\n CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n\ndiff --git a/doc/guides/nics/features/xenvirt.ini b/doc/guides/nics/features/xenvirt.ini\ndeleted file mode 100644\nindex 8ab5f46..0000000\n--- a/doc/guides/nics/features/xenvirt.ini\n+++ /dev/null\n@@ -1,6 +0,0 @@\n-;\n-; Supported features of the 'xenvirt' network poll mode driver.\n-;\n-; Refer to default.ini for the full list of available PMD features.\n-;\n-[Features]\ndiff --git a/drivers/net/Makefile b/drivers/net/Makefile\nindex d33c959..0e00cd1 100644\n--- a/drivers/net/Makefile\n+++ b/drivers/net/Makefile\n@@ -97,8 +97,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += virtio\n DEPDIRS-virtio = $(core-libs)\n DIRS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += vmxnet3\n DEPDIRS-vmxnet3 = $(core-libs)\n-DIRS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += xenvirt\n-DEPDIRS-xenvirt = $(core-libs) librte_cmdline\n \n ifeq ($(CONFIG_RTE_LIBRTE_KNI),y)\n DIRS-$(CONFIG_RTE_LIBRTE_PMD_KNI) += kni\ndiff --git a/drivers/net/xenvirt/Makefile b/drivers/net/xenvirt/Makefile\ndeleted file mode 100644\nindex 8b4b8f0..0000000\n--- a/drivers/net/xenvirt/Makefile\n+++ /dev/null\n@@ -1,57 +0,0 @@\n-#   BSD LICENSE\n-#\n-#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n-#   All rights reserved.\n-#\n-#   Redistribution and use in source and binary forms, with or without\n-#   modification, are permitted provided that the following conditions\n-#   are met:\n-#\n-#     * Redistributions of source code must retain the above copyright\n-#       notice, this list of conditions and the following disclaimer.\n-#     * Redistributions in binary form must reproduce the above copyright\n-#       notice, this list of conditions and the following disclaimer in\n-#       the documentation and/or other materials provided with the\n-#       distribution.\n-#     * Neither the name of Intel Corporation nor the names of its\n-#       contributors may be used to endorse or promote products derived\n-#       from this software without specific prior written permission.\n-#\n-#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n-#   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n-#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n-#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n-#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n-#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n-#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n-#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n-#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n-#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n-#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n-\n-include $(RTE_SDK)/mk/rte.vars.mk\n-\n-#\n-# library name\n-#\n-LIB = librte_pmd_xenvirt.a\n-\n-CFLAGS += -O3\n-CFLAGS += $(WERROR_FLAGS)\n-LDLIBS += -lxenstore\n-\n-EXPORT_MAP := rte_eth_xenvirt_version.map\n-\n-LIBABIVER := 1\n-\n-#\n-# all source are stored in SRCS-y\n-#\n-SRCS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += rte_eth_xenvirt.c rte_mempool_gntalloc.c rte_xen_lib.c\n-\n-#\n-# Export include files\n-#\n-SYMLINK-y-include += rte_eth_xenvirt.h\n-\n-include $(RTE_SDK)/mk/rte.lib.mk\ndiff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c\ndeleted file mode 100644\nindex e404b77..0000000\n--- a/drivers/net/xenvirt/rte_eth_xenvirt.c\n+++ /dev/null\n@@ -1,766 +0,0 @@\n-/*-\n- *   BSD LICENSE\n- *\n- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n- *   All rights reserved.\n- *\n- *   Redistribution and use in source and binary forms, with or without\n- *   modification, are permitted provided that the following conditions\n- *   are met:\n- *\n- *     * Redistributions of source code must retain the above copyright\n- *       notice, this list of conditions and the following disclaimer.\n- *     * Redistributions in binary form must reproduce the above copyright\n- *       notice, this list of conditions and the following disclaimer in\n- *       the documentation and/or other materials provided with the\n- *       distribution.\n- *     * Neither the name of Intel Corporation nor the names of its\n- *       contributors may be used to endorse or promote products derived\n- *       from this software without specific prior written permission.\n- *\n- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n- *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n- */\n-\n-#include <stdint.h>\n-#include <unistd.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#include <sys/types.h>\n-#include <sys/mman.h>\n-#include <errno.h>\n-#include <sys/user.h>\n-#ifndef PAGE_SIZE\n-#define PAGE_SIZE sysconf(_SC_PAGE_SIZE)\n-#endif\n-#include <linux/binfmts.h>\n-#include <xen/xen-compat.h>\n-#if __XEN_LATEST_INTERFACE_VERSION__ < 0x00040200\n-#include <xs.h>\n-#else\n-#include <xenstore.h>\n-#endif\n-#include <linux/virtio_ring.h>\n-\n-#include <rte_mbuf.h>\n-#include <rte_ethdev.h>\n-#include <rte_malloc.h>\n-#include <rte_memcpy.h>\n-#include <rte_string_fns.h>\n-#include <rte_vdev.h>\n-#include <cmdline_parse.h>\n-#include <cmdline_parse_etheraddr.h>\n-\n-#include \"rte_xen_lib.h\"\n-#include \"virtqueue.h\"\n-#include \"rte_eth_xenvirt.h\"\n-\n-#define VQ_DESC_NUM 256\n-#define VIRTIO_MBUF_BURST_SZ 64\n-\n-/* virtio_idx is increased after new device is created.*/\n-static int virtio_idx = 0;\n-\n-static struct rte_eth_link pmd_link = {\n-\t\t.link_speed = ETH_SPEED_NUM_10G,\n-\t\t.link_duplex = ETH_LINK_FULL_DUPLEX,\n-\t\t.link_status = ETH_LINK_DOWN,\n-\t\t.link_autoneg = ETH_LINK_SPEED_FIXED\n-};\n-\n-static void\n-eth_xenvirt_free_queues(struct rte_eth_dev *dev);\n-\n-static uint16_t\n-eth_xenvirt_rx(void *q, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\n-{\n-\tstruct virtqueue *rxvq = q;\n-\tstruct rte_mbuf *rxm, *new_mbuf;\n-\tuint16_t nb_used, num;\n-\tuint32_t len[VIRTIO_MBUF_BURST_SZ];\n-\tuint32_t i;\n-\tstruct pmd_internals *pi = rxvq->internals;\n-\n-\tnb_used = VIRTQUEUE_NUSED(rxvq);\n-\n-\trte_smp_rmb();\n-\tnum = (uint16_t)(likely(nb_used <= nb_pkts) ? nb_used : nb_pkts);\n-\tnum = (uint16_t)(likely(num <= VIRTIO_MBUF_BURST_SZ) ? num : VIRTIO_MBUF_BURST_SZ);\n-\tif (unlikely(num == 0)) return 0;\n-\n-\tnum = virtqueue_dequeue_burst(rxvq, rx_pkts, len, num);\n-\tPMD_RX_LOG(DEBUG, \"used:%d dequeue:%d\\n\", nb_used, num);\n-\tfor (i = 0; i < num ; i ++) {\n-\t\trxm = rx_pkts[i];\n-\t\tPMD_RX_LOG(DEBUG, \"packet len:%d\\n\", len[i]);\n-\t\trxm->next = NULL;\n-\t\trxm->data_off = RTE_PKTMBUF_HEADROOM;\n-\t\trxm->data_len = (uint16_t)(len[i] - sizeof(struct virtio_net_hdr));\n-\t\trxm->nb_segs = 1;\n-\t\trxm->port = pi->port_id;\n-\t\trxm->pkt_len  = (uint32_t)(len[i] - sizeof(struct virtio_net_hdr));\n-\t}\n-\t/* allocate new mbuf for the used descriptor */\n-\twhile (likely(!virtqueue_full(rxvq))) {\n-\t\tnew_mbuf = rte_mbuf_raw_alloc(rxvq->mpool);\n-\t\tif (unlikely(new_mbuf == NULL)) {\n-\t\t\tbreak;\n-\t\t}\n-\t\tif (unlikely(virtqueue_enqueue_recv_refill(rxvq, new_mbuf))) {\n-\t\t\trte_pktmbuf_free_seg(new_mbuf);\n-\t\t\tbreak;\n-\t\t}\n-\t}\n-\tpi->eth_stats.ipackets += num;\n-\treturn num;\n-}\n-\n-static uint16_t\n-eth_xenvirt_tx(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\n-{\n-\tstruct virtqueue *txvq = tx_queue;\n-\tstruct rte_mbuf *txm;\n-\tuint16_t nb_used, nb_tx, num, i;\n-\tint error;\n-\tuint32_t len[VIRTIO_MBUF_BURST_SZ];\n-\tstruct rte_mbuf *snd_pkts[VIRTIO_MBUF_BURST_SZ];\n-\tstruct pmd_internals *pi = txvq->internals;\n-\n-\tnb_tx = 0;\n-\n-\tif (unlikely(nb_pkts == 0))\n-\t\treturn 0;\n-\n-\tPMD_TX_LOG(DEBUG, \"%d packets to xmit\", nb_pkts);\n-\tnb_used = VIRTQUEUE_NUSED(txvq);\n-\n-\trte_smp_rmb();\n-\n-\tnum = (uint16_t)(likely(nb_used <= VIRTIO_MBUF_BURST_SZ) ? nb_used : VIRTIO_MBUF_BURST_SZ);\n-\tnum = virtqueue_dequeue_burst(txvq, snd_pkts, len, num);\n-\n-\tfor (i = 0; i < num ; i ++) {\n-\t\t/* mergable not supported, one segment only */\n-\t\trte_pktmbuf_free_seg(snd_pkts[i]);\n-\t}\n-\n-\twhile (nb_tx < nb_pkts) {\n-\t\tif (likely(!virtqueue_full(txvq))) {\n-\t\t/* TODO drop tx_pkts if it contains multiple segments */\n-\t\t\ttxm = tx_pkts[nb_tx];\n-\t\t\terror = virtqueue_enqueue_xmit(txvq, txm);\n-\t\t\tif (unlikely(error)) {\n-\t\t\t\tif (error == ENOSPC)\n-\t\t\t\t\tPMD_TX_LOG(ERR, \"virtqueue_enqueue Free count = 0\\n\");\n-\t\t\t\telse if (error == EMSGSIZE)\n-\t\t\t\t\tPMD_TX_LOG(ERR, \"virtqueue_enqueue Free count < 1\\n\");\n-\t\t\t\telse\n-\t\t\t\t\tPMD_TX_LOG(ERR, \"virtqueue_enqueue error: %d\\n\", error);\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t\tnb_tx++;\n-\t\t} else {\n-\t\t\tPMD_TX_LOG(ERR, \"No free tx descriptors to transmit\\n\");\n-\t\t\t/* virtqueue_notify not needed in our para-virt solution */\n-\t\t\tbreak;\n-\t\t}\n-\t}\n-\tpi->eth_stats.opackets += nb_tx;\n-\treturn nb_tx;\n-}\n-\n-static int\n-eth_dev_configure(struct rte_eth_dev *dev __rte_unused)\n-{\n-\tRTE_LOG(ERR, PMD, \"%s\\n\", __func__);\n-\treturn 0;\n-}\n-\n-/*\n- * Create a shared page between guest and host.\n- * Host monitors this page if it is cleared on unmap, and then\n- * do necessary clean up.\n- */\n-static void\n-gntalloc_vring_flag(int vtidx)\n-{\n-\tchar key_str[PATH_MAX];\n-\tchar val_str[PATH_MAX];\n-\tuint32_t gref_tmp;\n-\tvoid *ptr;\n-\n-\tif (grefwatch_from_alloc(&gref_tmp, &ptr)) {\n-\t\tRTE_LOG(ERR, PMD, \"grefwatch_from_alloc error\\n\");\n-\t\texit(0);\n-\t}\n-\n-\t*(uint8_t *)ptr = MAP_FLAG;\n-\tsnprintf(val_str, sizeof(val_str), \"%u\", gref_tmp);\n-\tsnprintf(key_str, sizeof(key_str),\n-\t\tDPDK_XENSTORE_PATH\"%d\"VRING_FLAG_STR, vtidx);\n-\txenstore_write(key_str, val_str);\n-}\n-\n-/*\n- * Notify host this virtio device is started.\n- * Host could start polling this device.\n- */\n-static void\n-dev_start_notify(int vtidx)\n-{\n-\tchar key_str[PATH_MAX];\n-\tchar val_str[PATH_MAX];\n-\n-\tRTE_LOG(INFO, PMD, \"%s: virtio %d is started\\n\", __func__, vtidx);\n-\tgntalloc_vring_flag(vtidx);\n-\n-\tsnprintf(key_str, sizeof(key_str), \"%s%s%d\",\n-\t\tDPDK_XENSTORE_PATH, EVENT_TYPE_START_STR,\n-\t\t\tvtidx);\n-\tsnprintf(val_str, sizeof(val_str), \"1\");\n-\txenstore_write(key_str, val_str);\n-}\n-\n-/*\n- * Notify host this virtio device is stopped.\n- * Host could stop polling this device.\n- */\n-static void\n-dev_stop_notify(int vtidx)\n-{\n-\tRTE_SET_USED(vtidx);\n-}\n-\n-\n-static int\n-update_mac_address(struct ether_addr *mac_addrs, int vtidx)\n-{\n-\tchar key_str[PATH_MAX];\n-\tchar val_str[PATH_MAX];\n-\tint rv;\n-\n-\tif (mac_addrs == NULL) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: NULL pointer mac specified\\n\", __func__);\n-\t\treturn -1;\n-\t}\n-\trv = snprintf(key_str, sizeof(key_str),\n-\t\t\tDPDK_XENSTORE_PATH\"%d_ether_addr\", vtidx);\n-\tif (rv == -1)\n-\t\treturn rv;\n-\trv = snprintf(val_str, sizeof(val_str), \"%02x:%02x:%02x:%02x:%02x:%02x\",\n-\t\t\tmac_addrs->addr_bytes[0],\n-\t\t\tmac_addrs->addr_bytes[1],\n-\t\t\tmac_addrs->addr_bytes[2],\n-\t\t\tmac_addrs->addr_bytes[3],\n-\t\t\tmac_addrs->addr_bytes[4],\n-\t\t\tmac_addrs->addr_bytes[5]);\n-\tif (rv == -1)\n-\t\treturn rv;\n-\tif (xenstore_write(key_str, val_str))\n-\t\treturn rv;\n-\treturn 0;\n-}\n-\n-\n-static int\n-eth_dev_start(struct rte_eth_dev *dev)\n-{\n-\tstruct virtqueue *rxvq = dev->data->rx_queues[0];\n-\tstruct virtqueue *txvq = dev->data->tx_queues[0];\n-\tstruct rte_mbuf *m;\n-\tstruct pmd_internals *pi = (struct pmd_internals *)dev->data->dev_private;\n-\tint rv;\n-\n-\tdev->data->dev_link.link_status = ETH_LINK_UP;\n-\twhile (!virtqueue_full(rxvq)) {\n-\t\tm = rte_mbuf_raw_alloc(rxvq->mpool);\n-\t\tif (m == NULL)\n-\t\t\tbreak;\n-\t\t/* Enqueue allocated buffers. */\n-\t\tif (virtqueue_enqueue_recv_refill(rxvq, m)) {\n-\t\t\trte_pktmbuf_free_seg(m);\n-\t\t\tbreak;\n-\t\t}\n-\t}\n-\n-\trxvq->internals = pi;\n-\ttxvq->internals = pi;\n-\n-\trv = update_mac_address(dev->data->mac_addrs, pi->virtio_idx);\n-\tif (rv)\n-\t\treturn -1;\n-\tdev_start_notify(pi->virtio_idx);\n-\n-\treturn 0;\n-}\n-\n-static void\n-eth_dev_stop(struct rte_eth_dev *dev)\n-{\n-\tstruct pmd_internals *pi = (struct pmd_internals *)dev->data->dev_private;\n-\n-\tdev->data->dev_link.link_status = ETH_LINK_DOWN;\n-\tdev_stop_notify(pi->virtio_idx);\n-}\n-\n-/*\n- * Notify host this virtio device is closed.\n- * Host could do necessary clean up to this device.\n- */\n-static void\n-eth_dev_close(struct rte_eth_dev *dev)\n-{\n-\teth_xenvirt_free_queues(dev);\n-}\n-\n-static void\n-eth_dev_info(struct rte_eth_dev *dev,\n-\t\tstruct rte_eth_dev_info *dev_info)\n-{\n-\tstruct pmd_internals *internals = dev->data->dev_private;\n-\n-\tRTE_SET_USED(internals);\n-\tdev_info->max_mac_addrs = 1;\n-\tdev_info->max_rx_pktlen = (uint32_t)2048;\n-\tdev_info->max_rx_queues = (uint16_t)1;\n-\tdev_info->max_tx_queues = (uint16_t)1;\n-\tdev_info->min_rx_bufsize = 0;\n-}\n-\n-static void\n-eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n-{\n-\tstruct pmd_internals *internals = dev->data->dev_private;\n-\tif(stats)\n-\t\trte_memcpy(stats, &internals->eth_stats, sizeof(*stats));\n-}\n-\n-static void\n-eth_stats_reset(struct rte_eth_dev *dev)\n-{\n-\tstruct pmd_internals *internals = dev->data->dev_private;\n-\t/* Reset software totals */\n-\tmemset(&internals->eth_stats, 0, sizeof(internals->eth_stats));\n-}\n-\n-static void\n-eth_queue_release(void *q)\n-{\n-\trte_free(q);\n-}\n-\n-static int\n-eth_link_update(struct rte_eth_dev *dev __rte_unused,\n-\t\tint wait_to_complete __rte_unused)\n-{\n-\treturn 0;\n-}\n-\n-/*\n- * Create shared vring between guest and host.\n- * Memory is allocated through grant alloc driver, so it is not physical continuous.\n- */\n-static void *\n-gntalloc_vring_create(int queue_type, uint32_t size, int vtidx)\n-{\n-\tchar key_str[PATH_MAX] = {0};\n-\tchar val_str[PATH_MAX] = {0};\n-\tvoid *va = NULL;\n-\tint pg_size;\n-\tuint32_t pg_num;\n-\tuint32_t *gref_arr = NULL;\n-\tphys_addr_t *pa_arr = NULL;\n-\tuint64_t start_index;\n-\tint rv;\n-\n-\tpg_size = getpagesize();\n-\tsize    = RTE_ALIGN_CEIL(size, pg_size);\n-\tpg_num  = size / pg_size;\n-\n-\tgref_arr = calloc(pg_num, sizeof(gref_arr[0]));\n-\tpa_arr  = calloc(pg_num, sizeof(pa_arr[0]));\n-\n-\tif (gref_arr == NULL || pa_arr == NULL) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: calloc failed\\n\", __func__);\n-\t\tgoto out;\n-\t}\n-\n-\tva  = gntalloc(size, gref_arr, &start_index);\n-\tif (va == NULL) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: gntalloc failed\\n\", __func__);\n-\t\tgoto out;\n-\t}\n-\n-\tif (get_phys_map(va, pa_arr, pg_num, pg_size))\n-\t\tgoto out;\n-\n-\t/* write in xenstore gref and pfn for each page of vring */\n-\tif (grant_node_create(pg_num, gref_arr, pa_arr, val_str, sizeof(val_str))) {\n-\t\tgntfree(va, size, start_index);\n-\t\tva = NULL;\n-\t\tgoto out;\n-\t}\n-\n-\tif (queue_type == VTNET_RQ)\n-\t\trv = snprintf(key_str, sizeof(key_str), DPDK_XENSTORE_PATH\"%d\"RXVRING_XENSTORE_STR, vtidx);\n-\telse\n-\t\trv = snprintf(key_str, sizeof(key_str), DPDK_XENSTORE_PATH\"%d\"TXVRING_XENSTORE_STR, vtidx);\n-\tif (rv == -1 || xenstore_write(key_str, val_str) == -1) {\n-\t\tgntfree(va, size, start_index);\n-\t\tva = NULL;\n-\t}\n-out:\n-\tfree(pa_arr);\n-\tfree(gref_arr);\n-\n-\treturn va;\n-}\n-\n-\n-\n-static struct virtqueue *\n-virtio_queue_setup(struct rte_eth_dev *dev, int queue_type)\n-{\n-\tstruct virtqueue *vq = NULL;\n-\tuint16_t vq_size = VQ_DESC_NUM;\n-\tint i = 0;\n-\tchar vq_name[VIRTQUEUE_MAX_NAME_SZ];\n-\tsize_t size;\n-\tstruct vring *vr;\n-\n-\t/* Allocate memory for virtqueue. */\n-\tif (queue_type == VTNET_RQ) {\n-\t\tsnprintf(vq_name, sizeof(vq_name), \"port%d_rvq\",\n-\t\t\t\tdev->data->port_id);\n-\t\tvq = rte_zmalloc(vq_name, sizeof(struct virtqueue) +\n-\t\t\tvq_size * sizeof(struct vq_desc_extra), RTE_CACHE_LINE_SIZE);\n-\t\tif (vq == NULL) {\n-\t\t\tRTE_LOG(ERR, PMD, \"%s: unabled to allocate virtqueue\\n\", __func__);\n-\t\t\treturn NULL;\n-\t\t}\n-\t\tmemcpy(vq->vq_name, vq_name, sizeof(vq->vq_name));\n-\t} else if(queue_type == VTNET_TQ) {\n-\t\tsnprintf(vq_name, sizeof(vq_name), \"port%d_tvq\",\n-\t\t\tdev->data->port_id);\n-\t\tvq = rte_zmalloc(vq_name, sizeof(struct virtqueue) +\n-\t\t\tvq_size * sizeof(struct vq_desc_extra), RTE_CACHE_LINE_SIZE);\n-\t\tif (vq == NULL) {\n-\t\t\tRTE_LOG(ERR, PMD, \"%s: unabled to allocate virtqueue\\n\", __func__);\n-\t\t\treturn NULL;\n-\t\t}\n-\t\tmemcpy(vq->vq_name, vq_name, sizeof(vq->vq_name));\n-\t}\n-\n-\tmemcpy(vq->vq_name, vq_name, sizeof(vq->vq_name));\n-\n-\tvq->vq_alignment = VIRTIO_PCI_VRING_ALIGN;\n-\tvq->vq_nentries = vq_size;\n-\tvq->vq_free_cnt = vq_size;\n-\t/* Calcuate vring size according to virtio spec */\n-\tsize = vring_size(vq_size, VIRTIO_PCI_VRING_ALIGN);\n-\tvq->vq_ring_size = RTE_ALIGN_CEIL(size, VIRTIO_PCI_VRING_ALIGN);\n-\t/* Allocate memory for virtio vring through gntalloc driver*/\n-\tvq->vq_ring_virt_mem = gntalloc_vring_create(queue_type, vq->vq_ring_size,\n-\t\t((struct pmd_internals *)dev->data->dev_private)->virtio_idx);\n-\tmemset(vq->vq_ring_virt_mem, 0, vq->vq_ring_size);\n-\tvr = &vq->vq_ring;\n-\tvring_init(vr, vq_size, vq->vq_ring_virt_mem, vq->vq_alignment);\n-\t/*\n-\t * Locally maintained last consumed index, this idex trails\n-\t * vq_ring.used->idx.\n-\t */\n-\tvq->vq_used_cons_idx = 0;\n-\tvq->vq_desc_head_idx = 0;\n-\tvq->vq_free_cnt = vq->vq_nentries;\n-\tmemset(vq->vq_descx, 0, sizeof(struct vq_desc_extra) * vq->vq_nentries);\n-\n-\t/* Chain all the descriptors in the ring with an END */\n-\tfor (i = 0; i < vq_size - 1; i++)\n-\t\tvr->desc[i].next = (uint16_t)(i + 1);\n-\tvr->desc[i].next = VQ_RING_DESC_CHAIN_END;\n-\n-\treturn vq;\n-}\n-\n-static int\n-eth_rx_queue_setup(struct rte_eth_dev *dev,uint16_t rx_queue_id,\n-\t\t\t\tuint16_t nb_rx_desc __rte_unused,\n-\t\t\t\tunsigned int socket_id __rte_unused,\n-\t\t\t\tconst struct rte_eth_rxconf *rx_conf __rte_unused,\n-\t\t\t\tstruct rte_mempool *mb_pool)\n-{\n-\tstruct virtqueue *vq;\n-\tvq = dev->data->rx_queues[rx_queue_id] = virtio_queue_setup(dev, VTNET_RQ);\n-\tvq->mpool = mb_pool;\n-\treturn 0;\n-}\n-\n-static int\n-eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,\n-\t\t\t\tuint16_t nb_tx_desc __rte_unused,\n-\t\t\t\tunsigned int socket_id __rte_unused,\n-\t\t\t\tconst struct rte_eth_txconf *tx_conf __rte_unused)\n-{\n-\tdev->data->tx_queues[tx_queue_id] = virtio_queue_setup(dev, VTNET_TQ);\n-\treturn 0;\n-}\n-\n-static void\n-eth_xenvirt_free_queues(struct rte_eth_dev *dev)\n-{\n-\tint i;\n-\n-\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n-\t\teth_queue_release(dev->data->rx_queues[i]);\n-\t\tdev->data->rx_queues[i] = NULL;\n-\t}\n-\tdev->data->nb_rx_queues = 0;\n-\n-\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n-\t\teth_queue_release(dev->data->tx_queues[i]);\n-\t\tdev->data->tx_queues[i] = NULL;\n-\t}\n-\tdev->data->nb_tx_queues = 0;\n-}\n-\n-static const struct eth_dev_ops ops = {\n-\t.dev_start = eth_dev_start,\n-\t.dev_stop = eth_dev_stop,\n-\t.dev_close = eth_dev_close,\n-\t.dev_configure = eth_dev_configure,\n-\t.dev_infos_get = eth_dev_info,\n-\t.rx_queue_setup = eth_rx_queue_setup,\n-\t.tx_queue_setup = eth_tx_queue_setup,\n-\t.rx_queue_release = eth_queue_release,\n-\t.tx_queue_release = eth_queue_release,\n-\t.link_update = eth_link_update,\n-\t.stats_get = eth_stats_get,\n-\t.stats_reset = eth_stats_reset,\n-};\n-\n-\n-static int\n-rte_eth_xenvirt_parse_args(struct xenvirt_dict *dict,\n-\t\t\tconst char *name, const char *params)\n-{\n-\tint i;\n-\tchar *pairs[RTE_ETH_XENVIRT_MAX_ARGS];\n-\tint num_of_pairs;\n-\tchar *pair[2];\n-\tchar *args;\n-\tint ret = -1;\n-\n-\tif (params == NULL)\n-\t\treturn 0;\n-\n-\targs = rte_zmalloc(NULL, strlen(params) + 1, RTE_CACHE_LINE_SIZE);\n-\tif (args == NULL) {\n-\t\tRTE_LOG(ERR, PMD, \"Couldn't parse %s device \\n\", name);\n-\t\treturn -1;\n-\t}\n-\trte_memcpy(args, params, strlen(params));\n-\n-\tnum_of_pairs = rte_strsplit(args, strnlen(args, MAX_ARG_STRLEN),\n-\t\t\t\t\tpairs,\n-\t\t\t\t\tRTE_ETH_XENVIRT_MAX_ARGS ,\n-\t\t\t\t\tRTE_ETH_XENVIRT_PAIRS_DELIM);\n-\n-\tfor (i = 0; i < num_of_pairs; i++) {\n-\t\tpair[0] = NULL;\n-\t\tpair[1] = NULL;\n-\t\trte_strsplit(pairs[i], strnlen(pairs[i], MAX_ARG_STRLEN),\n-\t\t\t\t\tpair, 2,\n-\t\t\t\t\tRTE_ETH_XENVIRT_KEY_VALUE_DELIM);\n-\n-\t\tif (pair[0] == NULL || pair[1] == NULL || pair[0][0] == 0\n-\t\t\t|| pair[1][0] == 0) {\n-\t\t\tRTE_LOG(ERR, PMD,\n-\t\t\t\t\"Couldn't parse %s device,\"\n-\t\t\t\t\"wrong key or value \\n\", name);\n-\t\t\tgoto err;\n-\t\t}\n-\n-\t\tif (!strncmp(pair[0], RTE_ETH_XENVIRT_MAC_PARAM,\n-\t\t\t\tsizeof(RTE_ETH_XENVIRT_MAC_PARAM))) {\n-\t\t\tif (cmdline_parse_etheraddr(NULL,\n-\t\t\t\t\t\t    pair[1],\n-\t\t\t\t\t\t    &dict->addr,\n-\t\t\t\t\t\t    sizeof(dict->addr)) < 0) {\n-\t\t\t\tRTE_LOG(ERR, PMD,\n-\t\t\t\t\t\"Invalid %s device ether address\\n\",\n-\t\t\t\t\tname);\n-\t\t\t\tgoto err;\n-\t\t\t}\n-\n-\t\t\tdict->addr_valid = 1;\n-\t\t}\n-\t}\n-\n-\tret = 0;\n-err:\n-\trte_free(args);\n-\treturn ret;\n-}\n-\n-enum dev_action {\n-\tDEV_CREATE,\n-\tDEV_ATTACH\n-};\n-\n-static struct rte_vdev_driver pmd_xenvirt_drv;\n-\n-static int\n-eth_dev_xenvirt_create(const char *name, const char *params,\n-\t\tconst unsigned numa_node,\n-                enum dev_action action)\n-{\n-\tstruct rte_eth_dev_data *data = NULL;\n-\tstruct pmd_internals *internals = NULL;\n-\tstruct rte_eth_dev *eth_dev = NULL;\n-\tstruct xenvirt_dict dict;\n-\n-\tmemset(&dict, 0, sizeof(struct xenvirt_dict));\n-\n-\tRTE_LOG(INFO, PMD, \"Creating virtio rings backed ethdev on numa socket %u\\n\",\n-\t\t\tnuma_node);\n-\tRTE_SET_USED(action);\n-\n-\tif (rte_eth_xenvirt_parse_args(&dict, name, params) < 0) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: Failed to parse ethdev parameters\\n\", __func__);\n-\t\treturn -1;\n-\t}\n-\n-\t/* now do all data allocation - for eth_dev structure, dummy pci driver\n-\t * and internal (private) data\n-\t */\n-\tdata = rte_zmalloc_socket(name, sizeof(*data), 0, numa_node);\n-\tif (data == NULL)\n-\t\tgoto err;\n-\n-\tinternals = rte_zmalloc_socket(name, sizeof(*internals), 0, numa_node);\n-\tif (internals == NULL)\n-\t\tgoto err;\n-\n-\t/* reserve an ethdev entry */\n-\teth_dev = rte_eth_dev_allocate(name);\n-\tif (eth_dev == NULL)\n-\t\tgoto err;\n-\n-\tdata->dev_private = internals;\n-\tdata->port_id = eth_dev->data->port_id;\n-\tdata->nb_rx_queues = (uint16_t)1;\n-\tdata->nb_tx_queues = (uint16_t)1;\n-\tdata->dev_link = pmd_link;\n-\tdata->mac_addrs = rte_zmalloc(\"xen_virtio\", ETHER_ADDR_LEN, 0);\n-\n-\tif(dict.addr_valid)\n-\t\tmemcpy(&data->mac_addrs->addr_bytes, &dict.addr, sizeof(struct ether_addr));\n-\telse\n-\t\teth_random_addr(&data->mac_addrs->addr_bytes[0]);\n-\n-\teth_dev->data = data;\n-\teth_dev->dev_ops = &ops;\n-\n-\teth_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE;\n-\teth_dev->data->kdrv = RTE_KDRV_NONE;\n-\teth_dev->data->numa_node = numa_node;\n-\n-\teth_dev->rx_pkt_burst = eth_xenvirt_rx;\n-\teth_dev->tx_pkt_burst = eth_xenvirt_tx;\n-\n-\tinternals->virtio_idx = virtio_idx++;\n-\tinternals->port_id = eth_dev->data->port_id;\n-\n-\treturn 0;\n-\n-err:\n-\trte_free(data);\n-\trte_free(internals);\n-\n-\treturn -1;\n-}\n-\n-\n-static int\n-eth_dev_xenvirt_free(const char *name, const unsigned numa_node)\n-{\n-\tstruct rte_eth_dev *eth_dev = NULL;\n-\n-\tRTE_LOG(DEBUG, PMD,\n-\t\t\"Free virtio rings backed ethdev on numa socket %u\\n\",\n-\t\tnuma_node);\n-\n-\t/* find an ethdev entry */\n-\teth_dev = rte_eth_dev_allocated(name);\n-\tif (eth_dev == NULL)\n-\t\treturn -1;\n-\n-\tif (eth_dev->data->dev_started == 1) {\n-\t\teth_dev_stop(eth_dev);\n-\t\teth_dev_close(eth_dev);\n-\t}\n-\n-\teth_dev->rx_pkt_burst = NULL;\n-\teth_dev->tx_pkt_burst = NULL;\n-\teth_dev->dev_ops = NULL;\n-\n-\trte_free(eth_dev->data);\n-\trte_free(eth_dev->data->dev_private);\n-\trte_free(eth_dev->data->mac_addrs);\n-\n-\tvirtio_idx--;\n-\n-\treturn 0;\n-}\n-\n-/*TODO: Support multiple process model */\n-static int\n-rte_pmd_xenvirt_probe(struct rte_vdev_device *dev)\n-{\n-\tif (virtio_idx == 0) {\n-\t\tif (xenstore_init() != 0) {\n-\t\t\tRTE_LOG(ERR, PMD, \"%s: xenstore init failed\\n\", __func__);\n-\t\t\treturn -1;\n-\t\t}\n-\t\tif (gntalloc_open() != 0) {\n-\t\t\tRTE_LOG(ERR, PMD, \"%s: grant init failed\\n\", __func__);\n-\t\t\treturn -1;\n-\t\t}\n-\t}\n-\teth_dev_xenvirt_create(rte_vdev_device_name(dev),\n-\t\trte_vdev_device_args(dev), rte_socket_id(), DEV_CREATE);\n-\treturn 0;\n-}\n-\n-static int\n-rte_pmd_xenvirt_remove(struct rte_vdev_device *dev)\n-{\n-\teth_dev_xenvirt_free(rte_vdev_device_name(dev), rte_socket_id());\n-\n-\tif (virtio_idx == 0) {\n-\t\tif (xenstore_uninit() != 0)\n-\t\t\tRTE_LOG(ERR, PMD, \"%s: xenstore uninit failed\\n\", __func__);\n-\n-\t\tgntalloc_close();\n-\t}\n-\treturn 0;\n-}\n-\n-static struct rte_vdev_driver pmd_xenvirt_drv = {\n-\t.probe = rte_pmd_xenvirt_probe,\n-\t.remove = rte_pmd_xenvirt_remove,\n-};\n-\n-RTE_PMD_REGISTER_VDEV(net_xenvirt, pmd_xenvirt_drv);\n-RTE_PMD_REGISTER_ALIAS(net_xenvirt, eth_xenvirt);\n-RTE_PMD_REGISTER_PARAM_STRING(net_xenvirt,\n-\t\"mac=<mac addr>\");\ndiff --git a/drivers/net/xenvirt/rte_eth_xenvirt.h b/drivers/net/xenvirt/rte_eth_xenvirt.h\ndeleted file mode 100644\nindex 598adc6..0000000\n--- a/drivers/net/xenvirt/rte_eth_xenvirt.h\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-/*-\n- *   BSD LICENSE\n- *\n- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n- *   All rights reserved.\n- *\n- *   Redistribution and use in source and binary forms, with or without\n- *   modification, are permitted provided that the following conditions\n- *   are met:\n- *\n- *     * Redistributions of source code must retain the above copyright\n- *       notice, this list of conditions and the following disclaimer.\n- *     * Redistributions in binary form must reproduce the above copyright\n- *       notice, this list of conditions and the following disclaimer in\n- *       the documentation and/or other materials provided with the\n- *       distribution.\n- *     * Neither the name of Intel Corporation nor the names of its\n- *       contributors may be used to endorse or promote products derived\n- *       from this software without specific prior written permission.\n- *\n- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n- *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n- */\n-\n-#ifndef _RTE_ETH_XENVIRT_H_\n-#define _RTE_ETH_XENVIRT_H_\n-\n-#ifdef __cplusplus\n-extern \"C\" {\n-#endif\n-\n-#include <rte_mempool.h>\n-\n-/**\n- * Creates mempool for xen virtio PMD.\n- * This function uses memzone_reserve to allocate memory for meta data,\n- * and uses grant alloc driver to allocate memory for data area.\n- * The input parameters are exactly the same as rte_mempool_create.\n- */\n-struct rte_mempool *\n-rte_mempool_gntalloc_create(const char *name, unsigned elt_num, unsigned elt_size,\n-\t\t   unsigned cache_size, unsigned private_data_size,\n-\t\t   rte_mempool_ctor_t *mp_init, void *mp_init_arg,\n-\t\t   rte_mempool_obj_cb_t *obj_init, void *obj_init_arg,\n-\t\t   int socket_id, unsigned flags);\n-\n-\n-#ifdef __cplusplus\n-}\n-#endif\n-\n-#endif\ndiff --git a/drivers/net/xenvirt/rte_eth_xenvirt_version.map b/drivers/net/xenvirt/rte_eth_xenvirt_version.map\ndeleted file mode 100644\nindex dd636f7..0000000\n--- a/drivers/net/xenvirt/rte_eth_xenvirt_version.map\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-DPDK_2.0 {\n-\tglobal:\n-\n-\trte_mempool_gntalloc_create;\n-\n-\tlocal: *;\n-};\ndiff --git a/drivers/net/xenvirt/rte_mempool_gntalloc.c b/drivers/net/xenvirt/rte_mempool_gntalloc.c\ndeleted file mode 100644\nindex 73e82f8..0000000\n--- a/drivers/net/xenvirt/rte_mempool_gntalloc.c\n+++ /dev/null\n@@ -1,295 +0,0 @@\n-/*-\n- *   BSD LICENSE\n- *\n- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n- *   All rights reserved.\n- *\n- *   Redistribution and use in source and binary forms, with or without\n- *   modification, are permitted provided that the following conditions\n- *   are met:\n- *\n- *     * Redistributions of source code must retain the above copyright\n- *       notice, this list of conditions and the following disclaimer.\n- *     * Redistributions in binary form must reproduce the above copyright\n- *       notice, this list of conditions and the following disclaimer in\n- *       the documentation and/or other materials provided with the\n- *       distribution.\n- *     * Neither the name of Intel Corporation nor the names of its\n- *       contributors may be used to endorse or promote products derived\n- *       from this software without specific prior written permission.\n- *\n- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n- *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n- */\n-\n-#include <stdint.h>\n-#include <unistd.h>\n-#include <stdlib.h>\n-#include <sys/mman.h>\n-#include <sys/ioctl.h>\n-#include <string.h>\n-#include <xen/sys/gntalloc.h>\n-\n-#include <rte_common.h>\n-#include <rte_mempool.h>\n-#include <rte_memory.h>\n-#include <rte_errno.h>\n-\n-#include \"rte_xen_lib.h\"\n-#include \"rte_eth_xenvirt.h\"\n-\n-struct _gntarr {\n-\tuint32_t gref;\n-\tphys_addr_t pa;\n-\tuint64_t index;\n-\tvoid *va;\n-};\n-\n-struct _mempool_gntalloc_info {\n-\tstruct rte_mempool *mp;\n-\tuint32_t pg_num;\n-\tuint32_t *gref_arr;\n-\tphys_addr_t *pa_arr;\n-\tvoid *va;\n-\tuint32_t mempool_idx;\n-\tuint64_t start_index;\n-};\n-\n-\n-static rte_atomic32_t global_xenvirt_mempool_idx = RTE_ATOMIC32_INIT(-1);\n-\n-static int\n-compare(const void *p1, const void *p2)\n-{\n-\treturn ((const struct _gntarr *)p1)->pa  - ((const struct _gntarr *)p2)->pa;\n-}\n-\n-\n-static struct _mempool_gntalloc_info\n-_create_mempool(const char *name, unsigned elt_num, unsigned elt_size,\n-\t\t   unsigned cache_size, unsigned private_data_size,\n-\t\t   rte_mempool_ctor_t *mp_init, void *mp_init_arg,\n-\t\t   rte_mempool_obj_cb_t *obj_init, void *obj_init_arg,\n-\t\t   int socket_id, unsigned flags)\n-{\n-\tstruct _mempool_gntalloc_info mgi;\n-\tstruct rte_mempool *mp = NULL;\n-\tstruct rte_mempool_objsz  objsz;\n-\tuint32_t pg_num, rpg_num, pg_shift, pg_sz;\n-\tchar *va, *orig_va, *uv; /* uv: from which, the pages could be freed */\n-\tssize_t sz, usz; /* usz: unused size */\n-\t/*\n-\t * for each page allocated through xen_gntalloc driver,\n-\t * gref_arr:stores grant references,\n-\t * pa_arr: stores physical address,\n-\t * gnt_arr: stores all meta dat\n-\t */\n-\tuint32_t *gref_arr = NULL;\n-\tphys_addr_t *pa_arr = NULL;\n-\tstruct _gntarr *gnt_arr = NULL;\n-\t/* start index of the grant referances, used for dealloc*/\n-\tuint64_t start_index;\n-\tuint32_t i, j;\n-\tint rv = 0;\n-\tstruct ioctl_gntalloc_dealloc_gref arg;\n-\n-\tmgi.mp = NULL;\n-\tva = orig_va = uv = NULL;\n-\tpg_num = rpg_num = 0;\n-\tsz = 0;\n-\n-\tpg_sz = getpagesize();\n-\tif (rte_is_power_of_2(pg_sz) == 0) {\n-\t\tgoto out;\n-\t}\n-\tpg_shift = rte_bsf32(pg_sz);\n-\n-\trte_mempool_calc_obj_size(elt_size, flags, &objsz);\n-\tsz = rte_mempool_xmem_size(elt_num, objsz.total_size, pg_shift);\n-\tpg_num = sz >> pg_shift;\n-\n-\tpa_arr = calloc(pg_num, sizeof(pa_arr[0]));\n-\tgref_arr = calloc(pg_num, sizeof(gref_arr[0]));\n-\tgnt_arr  = calloc(pg_num, sizeof(gnt_arr[0]));\n-\tif ((gnt_arr == NULL) || (gref_arr == NULL) || (pa_arr == NULL))\n-\t\tgoto out;\n-\n-\t/* grant index is continuous in ascending order */\n-\torig_va = gntalloc(sz, gref_arr, &start_index);\n-\tif (orig_va == NULL)\n-\t\tgoto out;\n-\n-\tget_phys_map(orig_va, pa_arr, pg_num, pg_sz);\n-\tfor (i = 0; i < pg_num; i++) {\n-\t\tgnt_arr[i].index = start_index + i * pg_sz;\n-\t\tgnt_arr[i].gref = gref_arr[i];\n-\t\tgnt_arr[i].pa = pa_arr[i];\n-\t\tgnt_arr[i].va  = RTE_PTR_ADD(orig_va, i * pg_sz);\n-\t}\n-\tqsort(gnt_arr, pg_num, sizeof(struct _gntarr), compare);\n-\n-\tva = get_xen_virtual(sz, pg_sz);\n-\tif (va == NULL) {\n-\t\tgoto out;\n-\t}\n-\n-\t/*\n-\t * map one by one, as index isn't continuous now.\n-\t * pg_num VMAs, doesn't linux has a limitation on this?\n-\t */\n-\tfor (i = 0; i < pg_num; i++) {\n-\t/* update gref_arr and pa_arr after sort */\n-\t\tgref_arr[i] = gnt_arr[i].gref;\n-\t\tpa_arr[i]   = gnt_arr[i].pa;\n-\t\tgnt_arr[i].va = mmap(va + i * pg_sz, pg_sz, PROT_READ | PROT_WRITE,\n-\t\t\tMAP_SHARED | MAP_FIXED, gntalloc_fd, gnt_arr[i].index);\n-\t\tif ((gnt_arr[i].va == MAP_FAILED) || (gnt_arr[i].va != (va + i * pg_sz))) {\n-\t\t\tRTE_LOG(ERR, PMD, \"failed to map %d pages\\n\", i);\n-\t\t\tgoto mmap_failed;\n-\t\t}\n-\t}\n-\n-\t/*\n-\t * Check that allocated size is big enough to hold elt_num\n-\t * objects and a calcualte how many bytes are actually required.\n-\t */\n-\tusz = rte_mempool_xmem_usage(va, elt_num, objsz.total_size, pa_arr, pg_num, pg_shift);\n-\tif (usz < 0) {\n-\t\tmp = NULL;\n-\t\ti = pg_num;\n-\t\tgoto mmap_failed;\n-\t} else {\n-\t\t/* unmap unused pages if any */\n-\t\tuv = RTE_PTR_ADD(va, usz);\n-\t\tif ((usz = va + sz - uv) > 0) {\n-\n-\t\t\tRTE_LOG(ERR, PMD,\n-\t\t\t\t\"%s(%s): unmap unused %zu of %zu \"\n-\t\t\t\t\"mmaped bytes @%p orig:%p\\n\",\n-\t\t\t\t__func__, name, usz, sz, uv, va);\n-\t\t\tmunmap(uv, usz);\n-\t\t\ti = (sz - usz) / pg_sz;\n-\t\t\tfor (; i < pg_num; i++) {\n-\t\t\t\targ.count = 1;\n-\t\t\t\targ.index = gnt_arr[i].index;\n-\t\t\t\trv = ioctl(gntalloc_fd, IOCTL_GNTALLOC_DEALLOC_GREF, &arg);\n-\t\t\t\tif (rv) {\n-\t\t\t\t\t/* shouldn't fail here */\n-\t\t\t\t\tRTE_LOG(ERR, PMD, \"va=%p pa=%\"PRIu64\"x index=%\"PRIu64\" %s\\n\",\n-\t\t\t\t\t\tgnt_arr[i].va,\n-\t\t\t\t\t\tgnt_arr[i].pa,\n-\t\t\t\t\t\targ.index, strerror(errno));\n-\t\t\t\t\trte_panic(\"gntdealloc failed when freeing pages\\n\");\n-\t\t\t\t}\n-\t\t\t}\n-\n-\t\t\trpg_num = (sz - usz) >> pg_shift;\n-\t\t} else\n-\t\t\trpg_num = pg_num;\n-\n-\t\tmp = rte_mempool_xmem_create(name, elt_num, elt_size,\n-\t\t\t\tcache_size, private_data_size,\n-\t\t\t\tmp_init, mp_init_arg,\n-\t\t\t\tobj_init, obj_init_arg,\n-\t\t\t\tsocket_id, flags, va, pa_arr, rpg_num, pg_shift);\n-\n-\t\tRTE_ASSERT(elt_num == mp->size);\n-\t}\n-\tmgi.mp = mp;\n-\tmgi.pg_num = rpg_num;\n-\tmgi.gref_arr = gref_arr;\n-\tmgi.pa_arr = pa_arr;\n-\tif (mp)\n-\t\tmgi.mempool_idx = rte_atomic32_add_return(&global_xenvirt_mempool_idx, 1);\n-\tmgi.start_index = start_index;\n-\tmgi.va = va;\n-\n-\tif (mp == NULL) {\n-\t\ti = pg_num;\n-\t\tgoto mmap_failed;\n-\t}\n-\n-/*\n- * unmap only, without deallocate grant reference.\n- * unused pages have already been unmaped,\n- * unmap twice will fail, but it is safe.\n- */\n-mmap_failed:\n-\tfor (j = 0; j < i; j++) {\n-\t\tif (gnt_arr[i].va)\n-\t\t\tmunmap(gnt_arr[i].va, pg_sz);\n-\t}\n-out:\n-\tfree(gnt_arr);\n-\tif (orig_va)\n-\t\tmunmap(orig_va, sz);\n-\tif (mp == NULL) {\n-\t\tfree(gref_arr);\n-\t\tfree(pa_arr);\n-\n-\t\t/* some gref has already been de-allocated from the list in the driver,\n-\t\t * so dealloc one by one, and it is safe to deallocate twice\n-\t\t */\n-\t\tif (orig_va) {\n-\t\t\tfor (i = 0; i < pg_num; i++) {\n-\t\t\t\targ.index = start_index + i * pg_sz;\n-\t\t\t\trv = ioctl(gntalloc_fd, IOCTL_GNTALLOC_DEALLOC_GREF, arg);\n-\t\t\t}\n-\t\t}\n-\t}\n-\treturn mgi;\n-}\n-\n-struct rte_mempool *\n-rte_mempool_gntalloc_create(const char *name, unsigned elt_num, unsigned elt_size,\n-\t\t   unsigned cache_size, unsigned private_data_size,\n-\t\t   rte_mempool_ctor_t *mp_init, void *mp_init_arg,\n-\t\t   rte_mempool_obj_cb_t *obj_init, void *obj_init_arg,\n-\t\t   int socket_id, unsigned flags)\n-{\n-\tint rv;\n-\tuint32_t i;\n-\tstruct _mempool_gntalloc_info mgi;\n-\tstruct ioctl_gntalloc_dealloc_gref arg;\n-\tint pg_sz = getpagesize();\n-\n-\tmgi = _create_mempool(name, elt_num, elt_size,\n-\t\t\tcache_size, private_data_size,\n-\t\t\tmp_init, mp_init_arg,\n-\t\t\tobj_init, obj_init_arg,\n-\t\t\tsocket_id, flags);\n-\tif (mgi.mp) {\n-\t\trv = grant_gntalloc_mbuf_pool(mgi.mp,\n-\t\t\tmgi.pg_num,\n-\t\t\tmgi.gref_arr,\n-\t\t\tmgi.pa_arr,\n-\t\t\tmgi.mempool_idx);\n-\t\tfree(mgi.gref_arr);\n-\t\tfree(mgi.pa_arr);\n-\t\tif (rv == 0)\n-\t\t\treturn mgi.mp;\n-\t\t/*\n-\t\t * in _create_mempool, unused pages have already been unmapped, deallocagted\n-\t\t * unmap and dealloc the remained ones here.\n-\t\t */\n-\t\tmunmap(mgi.va, pg_sz * mgi.pg_num);\n-\t\tfor (i = 0; i < mgi.pg_num; i++) {\n-\t\t\targ.index = mgi.start_index + i * pg_sz;\n-\t\t\trv = ioctl(gntalloc_fd, IOCTL_GNTALLOC_DEALLOC_GREF, arg);\n-\t\t}\n-\t\treturn NULL;\n-\t}\n-\treturn NULL;\n-\n-\n-\n-}\ndiff --git a/drivers/net/xenvirt/rte_xen_lib.c b/drivers/net/xenvirt/rte_xen_lib.c\ndeleted file mode 100644\nindex 6c9a1d4..0000000\n--- a/drivers/net/xenvirt/rte_xen_lib.c\n+++ /dev/null\n@@ -1,454 +0,0 @@\n-/*-\n- *   BSD LICENSE\n- *\n- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n- *   All rights reserved.\n- *\n- *   Redistribution and use in source and binary forms, with or without\n- *   modification, are permitted provided that the following conditions\n- *   are met:\n- *\n- *     * Redistributions of source code must retain the above copyright\n- *       notice, this list of conditions and the following disclaimer.\n- *     * Redistributions in binary form must reproduce the above copyright\n- *       notice, this list of conditions and the following disclaimer in\n- *       the documentation and/or other materials provided with the\n- *       distribution.\n- *     * Neither the name of Intel Corporation nor the names of its\n- *       contributors may be used to endorse or promote products derived\n- *       from this software without specific prior written permission.\n- *\n- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n- *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n- */\n-\n-#include <stdint.h>\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <unistd.h>\n-#include <string.h>\n-#include <sys/types.h>\n-#include <fcntl.h>\n-#include <sys/mman.h>\n-#include <sys/ioctl.h>\n-#include <xen/xen-compat.h>\n-#if __XEN_LATEST_INTERFACE_VERSION__ < 0x00040200\n-#include <xs.h>\n-#else\n-#include <xenstore.h>\n-#endif\n-#include <xen/sys/gntalloc.h>\n-\n-#include <rte_common.h>\n-#include <rte_string_fns.h>\n-#include <rte_malloc.h>\n-\n-#include \"rte_xen_lib.h\"\n-\n-/*\n- * The grant node format in xenstore for vring/mpool is:\n- * 0_rx_vring_gref = \"gref1#, gref2#, gref3#\"\n- * 0_mempool_gref  = \"gref1#, gref2#, gref3#\"\n- * each gref# is a grant reference for a shared page.\n- * In each shared page, we store the grant_node_item items.\n- */\n-struct grant_node_item {\n-\tuint32_t gref;\n-\tuint32_t pfn;\n-} __attribute__((packed));\n-\n-/* fd for xen_gntalloc driver, used to allocate grant pages*/\n-int gntalloc_fd = -1;\n-\n-/* xenstore path for local domain, now it is '/local/domain/domid/' */\n-static char *dompath = NULL;\n-/* handle to xenstore read/write operations */\n-static struct xs_handle *xs = NULL;\n-/* flag to indicate if xenstore cleanup is required */\n-static bool is_xenstore_cleaned_up;\n-\n-/*\n- * Reserve a virtual address space.\n- * On success, returns the pointer. On failure, returns NULL.\n- */\n-void *\n-get_xen_virtual(size_t size, size_t page_sz)\n-{\n-\tvoid *addr;\n-\tuintptr_t aligned_addr;\n-\n-\taddr = mmap(NULL, size + page_sz, PROT_READ, MAP_SHARED | MAP_ANONYMOUS, -1, 0);\n-\tif (addr == MAP_FAILED) {\n-\t\tRTE_LOG(ERR, PMD, \"failed get a virtual area\\n\");\n-\t\treturn NULL;\n-\t}\n-\n-\taligned_addr = RTE_ALIGN_CEIL((uintptr_t)addr, page_sz);\n-\taddr = (void *)(aligned_addr);\n-\n-\treturn addr;\n-}\n-\n-/*\n- * Get the physical address for virtual memory starting at va.\n- */\n-int\n-get_phys_map(void *va, phys_addr_t pa[], uint32_t pg_num, uint32_t pg_sz)\n-{\n-\tint32_t fd, rc = 0;\n-\tuint32_t i, nb;\n-\toff_t ofs;\n-\n-\tofs = (uintptr_t)va / pg_sz * sizeof(*pa);\n-\tnb = pg_num * sizeof(*pa);\n-\n-\tif ((fd = open(PAGEMAP_FNAME, O_RDONLY)) < 0 ||\n-\t\t\t(rc = pread(fd, pa, nb, ofs)) < 0 ||\n-\t\t\t(rc -= nb) != 0) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: failed read of %u bytes from \\'%s\\' \"\n-\t\t\t\"at offset %lu, error code: %d\\n\",\n-\t\t\t__func__, nb, PAGEMAP_FNAME, (unsigned long)ofs, errno);\n-\t\trc = ENOENT;\n-\t}\n-\n-\tclose(fd);\n-\tfor (i = 0; i != pg_num; i++)\n-\t\tpa[i] = (pa[i] & PAGEMAP_PFN_MASK) * pg_sz;\n-\n-\treturn rc;\n-}\n-\n-int\n-gntalloc_open(void)\n-{\n-\tgntalloc_fd = open(XEN_GNTALLOC_FNAME, O_RDWR);\n-\treturn (gntalloc_fd != -1) ? 0 : -1;\n-}\n-\n-void\n-gntalloc_close(void)\n-{\n-\tif (gntalloc_fd != -1)\n-\t\tclose(gntalloc_fd);\n-\tgntalloc_fd = -1;\n-}\n-\n-void *\n-gntalloc(size_t size, uint32_t *gref, uint64_t *start_index)\n-{\n-\tint page_size = getpagesize();\n-\tuint32_t i, pg_num;\n-\tvoid *va;\n-\tint rv;\n-\tstruct ioctl_gntalloc_alloc_gref *arg;\n-\tstruct ioctl_gntalloc_dealloc_gref arg_d;\n-\n-\tif (size % page_size) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: %zu isn't multiple of page size\\n\",\n-\t\t\t__func__, size);\n-\t\treturn NULL;\n-\t}\n-\n-\tpg_num = size / page_size;\n-\targ = malloc(sizeof(*arg) + (pg_num - 1) * sizeof(uint32_t));\n-\tif (arg == NULL)\n-\t\treturn NULL;\n-\targ->domid = DOM0_DOMID;\n-\targ->flags = GNTALLOC_FLAG_WRITABLE;\n-\targ->count = pg_num;\n-\n-\trv = ioctl(gntalloc_fd, IOCTL_GNTALLOC_ALLOC_GREF, arg);\n-\tif (rv) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: ioctl error\\n\", __func__);\n-\t\tfree(arg);\n-\t\treturn NULL;\n-\t}\n-\n-\tva = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, gntalloc_fd, arg->index);\n-\tif (va == MAP_FAILED) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: mmap failed\\n\", __func__);\n-\t\targ_d.count = pg_num;\n-\t\targ_d.index = arg->index;\n-\t\tioctl(gntalloc_fd, IOCTL_GNTALLOC_DEALLOC_GREF, arg_d);\n-\t\tfree(arg);\n-\t\treturn NULL;\n-\t}\n-\n-\tif (gref) {\n-\t\tfor (i = 0; i < pg_num; i++) {\n-\t\t\tgref[i] = arg->gref_ids[i];\n-\t\t}\n-\t}\n-\tif (start_index)\n-\t\t*start_index = arg->index;\n-\n-\tfree(arg);\n-\n-\treturn va;\n-}\n-\n-int\n-grefwatch_from_alloc(uint32_t *gref, void **pptr)\n-{\n-\tint rv;\n-\tvoid *ptr;\n-\tint pg_size = getpagesize();\n-\tstruct ioctl_gntalloc_alloc_gref arg = {\n-\t\t.domid = DOM0_DOMID,\n-\t\t.flags = GNTALLOC_FLAG_WRITABLE,\n-\t\t.count = 1\n-\t};\n-\tstruct ioctl_gntalloc_dealloc_gref arg_d;\n-\tstruct ioctl_gntalloc_unmap_notify notify = {\n-\t\t.action = UNMAP_NOTIFY_CLEAR_BYTE\n-\t};\n-\n-\trv = ioctl(gntalloc_fd, IOCTL_GNTALLOC_ALLOC_GREF, &arg);\n-\tif (rv) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: ioctl error\\n\", __func__);\n-\t\treturn -1;\n-\t}\n-\n-\tptr = (void *)mmap(NULL, pg_size, PROT_READ|PROT_WRITE, MAP_SHARED, gntalloc_fd, arg.index);\n-\targ_d.index = arg.index;\n-\targ_d.count = 1;\n-\tif (ptr == MAP_FAILED) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: mmap failed\\n\", __func__);\n-\t\tioctl(gntalloc_fd, IOCTL_GNTALLOC_DEALLOC_GREF, &arg_d);\n-\t\treturn -1;\n-\t}\n-\tif (pptr)\n-\t\t*pptr = ptr;\n-\tif (gref)\n-\t\t*gref = arg.gref_ids[0];\n-\n-\tnotify.index = arg.index;\n-\trv = ioctl(gntalloc_fd, IOCTL_GNTALLOC_SET_UNMAP_NOTIFY, &notify);\n-\tif (rv) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: unmap notify failed\\n\", __func__);\n-\t\tmunmap(ptr, pg_size);\n-\t\tioctl(gntalloc_fd, IOCTL_GNTALLOC_DEALLOC_GREF, &arg_d);\n-\t\treturn -1;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-void\n-gntfree(void *va, size_t sz, uint64_t start_index)\n-{\n-\tstruct ioctl_gntalloc_dealloc_gref arg_d;\n-\n-\tif (va && sz) {\n-\t\tmunmap(va, sz);\n-\t\targ_d.count = sz / getpagesize();\n-\t\targ_d.index = start_index;\n-\t\tioctl(gntalloc_fd, IOCTL_GNTALLOC_DEALLOC_GREF, &arg_d);\n-\t}\n-}\n-\n-static int\n-xenstore_cleanup(void)\n-{\n-\tchar store_path[PATH_MAX] = {0};\n-\n-\tif (snprintf(store_path, sizeof(store_path),\n-\t\t\"%s%s\", dompath, DPDK_XENSTORE_NODE) == -1)\n-\t\treturn -1;\n-\n-\tif (xs_rm(xs, XBT_NULL, store_path) == false) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: failed cleanup node\\n\", __func__);\n-\t\treturn -1;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-int\n-xenstore_init(void)\n-{\n-\tunsigned int len, domid;\n-\tchar *buf;\n-\tchar *end;\n-\n-\txs = xs_domain_open();\n-\tif (xs == NULL) {\n-\t\tRTE_LOG(ERR, PMD,\"%s: xs_domain_open failed\\n\", __func__);\n-\t\treturn -1;\n-\t}\n-\tbuf = xs_read(xs, XBT_NULL, \"domid\", &len);\n-\tif (buf == NULL) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: failed read domid\\n\", __func__);\n-\t\treturn -1;\n-\t}\n-\terrno = 0;\n-\tdomid = strtoul(buf, &end, 0);\n-\tif (errno != 0 || end == NULL || end == buf ||  domid == 0)\n-\t\treturn -1;\n-\n-\tRTE_LOG(INFO, PMD, \"retrieved dom ID = %d\\n\", domid);\n-\n-\tdompath = xs_get_domain_path(xs, domid);\n-\tif (dompath == NULL)\n-\t\treturn -1;\n-\n-\txs_transaction_start(xs); /* When to stop transaction */\n-\n-\tif (is_xenstore_cleaned_up == 0) {\n-\t\tif (xenstore_cleanup())\n-\t\t\treturn -1;\n-\t\tis_xenstore_cleaned_up = 1;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-int\n-xenstore_uninit(void)\n-{\n-\txs_close(xs);\n-\n-\tif (is_xenstore_cleaned_up == 0) {\n-\t\tif (xenstore_cleanup())\n-\t\t\treturn -1;\n-\t\tis_xenstore_cleaned_up = 1;\n-\t}\n-\tfree(dompath);\n-\tdompath = NULL;\n-\n-\treturn 0;\n-}\n-\n-int\n-xenstore_write(const char *key_str, const char *val_str)\n-{\n-\tchar grant_path[PATH_MAX];\n-\tint rv, len;\n-\n-\tif (xs == NULL) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: xenstore init failed\\n\", __func__);\n-\t\treturn -1;\n-\t}\n-\trv = snprintf(grant_path, sizeof(grant_path), \"%s%s\", dompath, key_str);\n-\tif (rv == -1) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: snprintf %s %s failed\\n\",\n-\t\t\t__func__, dompath, key_str);\n-\t\treturn -1;\n-\t}\n-\tlen = strnlen(val_str, PATH_MAX);\n-\n-\tif (xs_write(xs, XBT_NULL, grant_path, val_str, len) == false) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: xs_write failed\\n\", __func__);\n-\t\treturn -1;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-int\n-grant_node_create(uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, char *val_str, size_t str_size)\n-{\n-\tuint64_t start_index;\n-\tint pg_size;\n-\tuint32_t pg_shift;\n-\tvoid *ptr = NULL;\n-\tuint32_t count, entries_per_pg;\n-\tuint32_t i, j = 0, k = 0;\n-\tuint32_t *gref_tmp;\n-\tint first = 1;\n-\tchar tmp_str[PATH_MAX] = {0};\n-\tint rv = -1;\n-\n-\tpg_size = getpagesize();\n-\tif (rte_is_power_of_2(pg_size) == 0) {\n-\t\treturn -1;\n-\t}\n-\tpg_shift = rte_bsf32(pg_size);\n-\tif (pg_size % sizeof(struct grant_node_item)) {\n-\t\tRTE_LOG(ERR, PMD, \"pg_size isn't a multiple of grant node item\\n\");\n-\t\treturn -1;\n-\t}\n-\n-\tentries_per_pg = pg_size / sizeof(struct grant_node_item);\n-\tcount  = (pg_num +  entries_per_pg - 1 ) / entries_per_pg;\n-\tgref_tmp = malloc(count * sizeof(uint32_t));\n-\tif (gref_tmp == NULL)\n-\t\treturn -1;\n-\tptr = gntalloc(pg_size * count, gref_tmp, &start_index);\n-\tif (ptr == NULL) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: gntalloc error of %d pages\\n\", __func__, count);\n-\t\tfree(gref_tmp);\n-\t\treturn -1;\n-\t}\n-\n-\twhile (j < pg_num) {\n-\t\tif (first) {\n-\t\t\trv = snprintf(val_str, str_size, \"%u\", gref_tmp[k]);\n-\t\t\tfirst = 0;\n-\t\t} else {\n-\t\t\tsnprintf(tmp_str, PATH_MAX, \"%s\", val_str);\n-\t\t\trv = snprintf(val_str, str_size, \"%s,%u\", tmp_str, gref_tmp[k]);\n-\t\t}\n-\t\tk++;\n-\t\tif (rv == -1)\n-\t\t\tbreak;\n-\n-\t\tfor (i = 0; i < entries_per_pg && j < pg_num ; i++) {\n-\t\t\t((struct grant_node_item *)ptr)->gref = gref_arr[j];\n-\t\t\t((struct grant_node_item *)ptr)->pfn =  pa_arr[j] >> pg_shift;\n-\t\t\tptr = RTE_PTR_ADD(ptr, sizeof(struct grant_node_item));\n-\t\t\tj++;\n-\t\t}\n-\t}\n-\tif (rv == -1) {\n-\t\tgntfree(ptr, pg_size * count, start_index);\n-\t} else\n-\t\trv = 0;\n-\tfree(gref_tmp);\n-\treturn rv;\n-}\n-\n-\n-int\n-grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, int mempool_idx)\n-{\n-\tchar key_str[PATH_MAX] = {0};\n-\tchar val_str[PATH_MAX] = {0};\n-\tvoid *mempool_obj_va;\n-\n-\tif (grant_node_create(pg_num, gref_arr, pa_arr, val_str, sizeof(val_str))) {\n-\t\treturn -1;\n-\t}\n-\n-\tif (snprintf(key_str, sizeof(key_str),\n-\t\tDPDK_XENSTORE_PATH\"%d\"MEMPOOL_XENSTORE_STR, mempool_idx) == -1)\n-\t\treturn -1;\n-\tif (xenstore_write(key_str, val_str) == -1)\n-\t\treturn -1;\n-\n-\tif (snprintf(key_str, sizeof(key_str),\n-\t\tDPDK_XENSTORE_PATH\"%d\"MEMPOOL_VA_XENSTORE_STR, mempool_idx) == -1)\n-\t\treturn -1;\n-\tif (mpool->nb_mem_chunks != 1) {\n-\t\tRTE_LOG(ERR, PMD,\n-\t\t\t\"mempool with more than 1 chunk is not supported\\n\");\n-\t\treturn -1;\n-\t}\n-\tmempool_obj_va = STAILQ_FIRST(&mpool->mem_list)->addr;\n-\tif (snprintf(val_str, sizeof(val_str), \"%\"PRIxPTR,\n-\t\t\t(uintptr_t)mempool_obj_va) == -1)\n-\t\treturn -1;\n-\tif (xenstore_write(key_str, val_str) == -1)\n-\t\treturn -1;\n-\n-\treturn 0;\n-}\ndiff --git a/drivers/net/xenvirt/rte_xen_lib.h b/drivers/net/xenvirt/rte_xen_lib.h\ndeleted file mode 100644\nindex d973eac..0000000\n--- a/drivers/net/xenvirt/rte_xen_lib.h\n+++ /dev/null\n@@ -1,116 +0,0 @@\n-/*-\n- *   BSD LICENSE\n- *\n- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n- *   All rights reserved.\n- *\n- *   Redistribution and use in source and binary forms, with or without\n- *   modification, are permitted provided that the following conditions\n- *   are met:\n- *\n- *     * Redistributions of source code must retain the above copyright\n- *       notice, this list of conditions and the following disclaimer.\n- *     * Redistributions in binary form must reproduce the above copyright\n- *       notice, this list of conditions and the following disclaimer in\n- *       the documentation and/or other materials provided with the\n- *       distribution.\n- *     * Neither the name of Intel Corporation nor the names of its\n- *       contributors may be used to endorse or promote products derived\n- *       from this software without specific prior written permission.\n- *\n- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n- *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n- */\n-\n-#ifndef _RTE_XEN_DUMMY_PMD_H\n-#define _RTE_XEN_DUMMY_PMD_H\n-\n-#include <stdint.h>\n-\n-#include <rte_common.h>\n-#include <rte_mempool.h>\n-#include <rte_ether.h>\n-\n-#define\tPAGEMAP_FNAME           \"/proc/self/pagemap\"\n-#define XEN_GNTALLOC_FNAME      \"/dev/xen/gntalloc\"\n-#define DPDK_XENSTORE_PATH      \"/control/dpdk/\"\n-#define DPDK_XENSTORE_NODE      \"/control/dpdk\"\n-/*format 0_mempool_gref = \"1537,1524,1533\" */\n-#define MEMPOOL_XENSTORE_STR    \"_mempool_gref\"\n-/*format 0_mempool_va = 0x80340000 */\n-#define MEMPOOL_VA_XENSTORE_STR \"_mempool_va\"\n-/*format 0_rx_vring_gref  = \"1537,1524,1533\" */\n-#define RXVRING_XENSTORE_STR    \"_rx_vring_gref\"\n-/*format 0_tx_vring_gref  = \"1537,1524,1533\" */\n-#define TXVRING_XENSTORE_STR    \"_tx_vring_gref\"\n-#define VRING_FLAG_STR          \"_vring_flag\"\n-/*format: event_type_start_0 = 1*/\n-#define EVENT_TYPE_START_STR    \"event_type_start_\"\n-\n-#define DOM0_DOMID 0\n-/*\n- * the pfn (page frame number) are bits 0-54 (see pagemap.txt in linux\n- * Documentation).\n- */\n-#define PAGEMAP_PFN_BITS\t54\n-#define PAGEMAP_PFN_MASK\tRTE_LEN2MASK(PAGEMAP_PFN_BITS, phys_addr_t)\n-\n-#define MAP_FLAG\t0xA5\n-\n-#define RTE_ETH_XENVIRT_PAIRS_DELIM ';'\n-#define RTE_ETH_XENVIRT_KEY_VALUE_DELIM '='\n-#define RTE_ETH_XENVIRT_MAX_ARGS 1\n-#define RTE_ETH_XENVIRT_MAC_PARAM \"mac\"\n-struct xenvirt_dict {\n-\tuint8_t addr_valid;\n-\tstruct ether_addr addr;\n-};\n-\n-extern int gntalloc_fd;\n-\n-int\n-gntalloc_open(void);\n-\n-void\n-gntalloc_close(void);\n-\n-void *\n-gntalloc(size_t sz, uint32_t *gref, uint64_t *start_index);\n-\n-void\n-gntfree(void *va, size_t sz, uint64_t start_index);\n-\n-int\n-xenstore_init(void);\n-\n-int\n-xenstore_uninit(void);\n-\n-int\n-xenstore_write(const char *key_str, const char *val_str);\n-\n-int\n-get_phys_map(void *va, phys_addr_t pa[], uint32_t pg_num, uint32_t pg_sz);\n-\n-void *\n-get_xen_virtual(size_t size, size_t page_sz);\n-\n-int\n-grefwatch_from_alloc(uint32_t *gref, void **pptr);\n-\n-\n-int grant_node_create(uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, char *val_str, size_t str_size);\n-\n-int\n-grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, int mempool_idx);\n-\n-#endif\ndiff --git a/drivers/net/xenvirt/virtio_logs.h b/drivers/net/xenvirt/virtio_logs.h\ndeleted file mode 100644\nindex d6c33f7..0000000\n--- a/drivers/net/xenvirt/virtio_logs.h\n+++ /dev/null\n@@ -1,70 +0,0 @@\n-/*-\n- *   BSD LICENSE\n- *\n- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n- *   All rights reserved.\n- *\n- *   Redistribution and use in source and binary forms, with or without\n- *   modification, are permitted provided that the following conditions\n- *   are met:\n- *\n- *     * Redistributions of source code must retain the above copyright\n- *       notice, this list of conditions and the following disclaimer.\n- *     * Redistributions in binary form must reproduce the above copyright\n- *       notice, this list of conditions and the following disclaimer in\n- *       the documentation and/or other materials provided with the\n- *       distribution.\n- *     * Neither the name of Intel Corporation nor the names of its\n- *       contributors may be used to endorse or promote products derived\n- *       from this software without specific prior written permission.\n- *\n- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n- *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n- */\n-\n-#ifndef _VIRTIO_LOGS_H_\n-#define _VIRTIO_LOGS_H_\n-\n-#include <rte_log.h>\n-\n-#ifdef RTE_LIBRTE_VIRTIO_DEBUG_INIT\n-#define PMD_INIT_LOG(level, fmt, args...) \\\n-\tRTE_LOG(level, PMD, \"%s(): \" fmt \"\\n\", __func__, ## args)\n-#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, \" >>\")\n-#else\n-#define PMD_INIT_LOG(level, fmt, args...) do { } while(0)\n-#define PMD_INIT_FUNC_TRACE() do { } while(0)\n-#endif\n-\n-#ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX\n-#define PMD_RX_LOG(level, fmt, args...) \\\n-\tRTE_LOG(level, PMD, \"%s() rx: \" fmt , __func__, ## args)\n-#else\n-#define PMD_RX_LOG(level, fmt, args...) do { } while(0)\n-#endif\n-\n-#ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX\n-#define PMD_TX_LOG(level, fmt, args...) \\\n-\tRTE_LOG(level, PMD, \"%s() tx: \" fmt , __func__, ## args)\n-#else\n-#define PMD_TX_LOG(level, fmt, args...) do { } while(0)\n-#endif\n-\n-\n-#ifdef RTE_LIBRTE_VIRTIO_DEBUG_DRIVER\n-#define PMD_DRV_LOG(level, fmt, args...) \\\n-\tRTE_LOG(level, PMD, \"%s(): \" fmt , __func__, ## args)\n-#else\n-#define PMD_DRV_LOG(level, fmt, args...) do { } while(0)\n-#endif\n-\n-#endif /* _VIRTIO_LOGS_H_ */\ndiff --git a/drivers/net/xenvirt/virtqueue.h b/drivers/net/xenvirt/virtqueue.h\ndeleted file mode 100644\nindex 1bb6877..0000000\n--- a/drivers/net/xenvirt/virtqueue.h\n+++ /dev/null\n@@ -1,273 +0,0 @@\n-/*-\n- *   BSD LICENSE\n- *\n- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n- *   All rights reserved.\n- *\n- *   Redistribution and use in source and binary forms, with or without\n- *   modification, are permitted provided that the following conditions\n- *   are met:\n- *\n- *     * Redistributions of source code must retain the above copyright\n- *       notice, this list of conditions and the following disclaimer.\n- *     * Redistributions in binary form must reproduce the above copyright\n- *       notice, this list of conditions and the following disclaimer in\n- *       the documentation and/or other materials provided with the\n- *       distribution.\n- *     * Neither the name of Intel Corporation nor the names of its\n- *       contributors may be used to endorse or promote products derived\n- *       from this software without specific prior written permission.\n- *\n- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n- *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n- */\n-\n-#ifndef _VIRTQUEUE_H_\n-#define _VIRTQUEUE_H_\n-\n-#include <stdint.h>\n-#include <linux/virtio_ring.h>\n-#include <linux/virtio_net.h>\n-\n-#include <rte_atomic.h>\n-#include <rte_memory.h>\n-#include <rte_memzone.h>\n-#include <rte_mempool.h>\n-\n-#include \"virtio_logs.h\"\n-\n-struct rte_mbuf;\n-\n-/* The alignment to use between consumer and producer parts of vring. */\n-#define VIRTIO_PCI_VRING_ALIGN 4096\n-\n-enum { VTNET_RQ = 0, VTNET_TQ = 1, VTNET_CQ = 2 };\n-\n-/**\n- * The maximum virtqueue size is 2^15. Use that value as the end of\n- * descriptor chain terminator since it will never be a valid index\n- * in the descriptor table. This is used to verify we are correctly\n- * handling vq_free_cnt.\n- */\n-#define VQ_RING_DESC_CHAIN_END 32768\n-\n-#define VIRTQUEUE_MAX_NAME_SZ  32\n-\n-struct pmd_internals {\n-\tstruct rte_eth_stats eth_stats;\n-\tint port_id;\n-\tint virtio_idx;\n-};\n-\n-\n-struct virtqueue {\n-\tchar vq_name[VIRTQUEUE_MAX_NAME_SZ];\n-\tstruct rte_mempool       *mpool;  /**< mempool for mbuf allocation */\n-\tuint16_t    queue_id;             /**< DPDK queue index. */\n-\tuint16_t    vq_queue_index;       /**< PCI queue index */\n-\tuint8_t     port_id;              /**< Device port identifier. */\n-\n-\tvoid        *vq_ring_virt_mem;    /**< virtual address of vring*/\n-\tint         vq_alignment;\n-\tint         vq_ring_size;\n-\n-\tstruct vring vq_ring;    /**< vring keeping desc, used and avail */\n-\tstruct pmd_internals *internals;  /**< virtio device internal info. */\n-\tuint16_t    vq_nentries; /**< vring desc numbers */\n-\tuint16_t    vq_desc_head_idx;\n-\tuint16_t    vq_free_cnt; /**< num of desc available */\n-\tuint16_t vq_used_cons_idx; /**< Last consumed desc in used table, trails vq_ring.used->idx*/\n-\n-\tstruct vq_desc_extra {\n-\t\tvoid              *cookie;\n-\t\tuint16_t          ndescs;\n-\t} vq_descx[0] __rte_cache_aligned;\n-};\n-\n-\n-#ifdef  RTE_LIBRTE_XENVIRT_DEBUG_DUMP\n-#define VIRTQUEUE_DUMP(vq) do { \\\n-\tuint16_t used_idx, nused; \\\n-\tused_idx = (vq)->vq_ring.used->idx; \\\n-\tnused = (uint16_t)(used_idx - (vq)->vq_used_cons_idx); \\\n-\tPMD_INIT_LOG(DEBUG, \\\n-\t  \"VQ: %s - size=%d; free=%d; used=%d; desc_head_idx=%d;\" \\\n-\t  \" avail.idx=%d; used_cons_idx=%d; used.idx=%d;\" \\\n-\t  \" avail.flags=0x%x; used.flags=0x%x\\n\", \\\n-\t  (vq)->vq_name, (vq)->vq_nentries, (vq)->vq_free_cnt, nused, \\\n-\t  (vq)->vq_desc_head_idx, (vq)->vq_ring.avail->idx, \\\n-\t  (vq)->vq_used_cons_idx, (vq)->vq_ring.used->idx, \\\n-\t  (vq)->vq_ring.avail->flags, (vq)->vq_ring.used->flags); \\\n-} while (0)\n-#else\n-#define VIRTQUEUE_DUMP(vq) do { } while (0)\n-#endif\n-\n-\n-/**\n- *  Dump virtqueue internal structures, for debug purpose only.\n- */\n-void virtqueue_dump(struct virtqueue *vq);\n-\n-/**\n- *  Get all mbufs to be freed.\n- */\n-struct rte_mbuf * virtqueue_detatch_unused(struct virtqueue *vq);\n-\n-static __rte_always_inline int\n-virtqueue_full(const struct virtqueue *vq)\n-{\n-\treturn vq->vq_free_cnt == 0;\n-}\n-\n-#define VIRTQUEUE_NUSED(vq) ((uint16_t)((vq)->vq_ring.used->idx - (vq)->vq_used_cons_idx))\n-\n-static __rte_always_inline void\n-vq_ring_update_avail(struct virtqueue *vq, uint16_t desc_idx)\n-{\n-\tuint16_t avail_idx;\n-\t/*\n-\t * Place the head of the descriptor chain into the next slot and make\n-\t * it usable to the host. The chain is made available now rather than\n-\t * deferring to virtqueue_notify() in the hopes that if the host is\n-\t * currently running on another CPU, we can keep it processing the new\n-\t * descriptor.\n-\t */\n-\tavail_idx = (uint16_t)(vq->vq_ring.avail->idx & (vq->vq_nentries - 1));\n-\tvq->vq_ring.avail->ring[avail_idx] = desc_idx;\n-\trte_smp_wmb();\n-\tvq->vq_ring.avail->idx++;\n-}\n-\n-static __rte_always_inline void\n-vq_ring_free_chain(struct virtqueue *vq, uint16_t desc_idx)\n-{\n-\tstruct vring_desc *dp;\n-\tstruct vq_desc_extra *dxp;\n-\n-\tdp  = &vq->vq_ring.desc[desc_idx];\n-\tdxp = &vq->vq_descx[desc_idx];\n-\tvq->vq_free_cnt = (uint16_t)(vq->vq_free_cnt + dxp->ndescs);\n-\twhile (dp->flags & VRING_DESC_F_NEXT) {\n-\t\tdp = &vq->vq_ring.desc[dp->next];\n-\t}\n-\tdxp->ndescs = 0;\n-\n-\t/*\n-\t * We must append the existing free chain, if any, to the end of\n-\t * newly freed chain. If the virtqueue was completely used, then\n-\t * head would be VQ_RING_DESC_CHAIN_END (ASSERTed above).\n-\t */\n-\tdp->next = vq->vq_desc_head_idx;\n-\tvq->vq_desc_head_idx = desc_idx;\n-}\n-\n-static __rte_always_inline int\n-virtqueue_enqueue_recv_refill(struct virtqueue *rxvq, struct rte_mbuf *cookie)\n-{\n-\tconst uint16_t needed = 1;\n-\tconst uint16_t head_idx = rxvq->vq_desc_head_idx;\n-\tstruct vring_desc *start_dp = rxvq->vq_ring.desc;\n-\tstruct vq_desc_extra *dxp;\n-\n-\tif (unlikely(rxvq->vq_free_cnt == 0))\n-\t\treturn -ENOSPC;\n-\tif (unlikely(rxvq->vq_free_cnt < needed))\n-\t\treturn -EMSGSIZE;\n-\tif (unlikely(head_idx >= rxvq->vq_nentries))\n-\t\treturn -EFAULT;\n-\n-\tdxp = &rxvq->vq_descx[head_idx];\n-\tdxp->cookie = (void *)cookie;\n-\tdxp->ndescs = needed;\n-\n-\tstart_dp[head_idx].addr  =\n-\t\t(uint64_t) ((uintptr_t)cookie->buf_addr + RTE_PKTMBUF_HEADROOM - sizeof(struct virtio_net_hdr));\n-\tstart_dp[head_idx].len   = cookie->buf_len - RTE_PKTMBUF_HEADROOM + sizeof(struct virtio_net_hdr);\n-\tstart_dp[head_idx].flags = VRING_DESC_F_WRITE;\n-\trxvq->vq_desc_head_idx   = start_dp[head_idx].next;\n-\trxvq->vq_free_cnt        = (uint16_t)(rxvq->vq_free_cnt - needed);\n-\tvq_ring_update_avail(rxvq, head_idx);\n-\n-\treturn 0;\n-}\n-\n-static __rte_always_inline int\n-virtqueue_enqueue_xmit(struct virtqueue *txvq, struct rte_mbuf *cookie)\n-{\n-\n-\tconst uint16_t needed = 2;\n-\tstruct vring_desc *start_dp =  txvq->vq_ring.desc;\n-\tuint16_t head_idx = txvq->vq_desc_head_idx;\n-\tuint16_t idx      = head_idx;\n-\tstruct vq_desc_extra *dxp;\n-\n-\tif (unlikely(txvq->vq_free_cnt == 0))\n-\t\treturn -ENOSPC;\n-\tif (unlikely(txvq->vq_free_cnt < needed))\n-\t\treturn -EMSGSIZE;\n-\tif (unlikely(head_idx >= txvq->vq_nentries))\n-\t\treturn -EFAULT;\n-\n-\tdxp = &txvq->vq_descx[idx];\n-\tdxp->cookie = (void *)cookie;\n-\tdxp->ndescs = needed;\n-\n-\tstart_dp = txvq->vq_ring.desc;\n-\tstart_dp[idx].addr  = 0;\n-/*\n- * TODO: save one desc here?\n- */\n-\tstart_dp[idx].len   = sizeof(struct virtio_net_hdr);\n-\tstart_dp[idx].flags = VRING_DESC_F_NEXT;\n-\tstart_dp[idx].addr  = (uintptr_t)NULL;\n-\tidx = start_dp[idx].next;\n-\tstart_dp[idx].addr  = (uint64_t)rte_pktmbuf_mtod(cookie, uintptr_t);\n-\tstart_dp[idx].len   = cookie->data_len;\n-\tstart_dp[idx].flags = 0;\n-\tidx = start_dp[idx].next;\n-\ttxvq->vq_desc_head_idx = idx;\n-\ttxvq->vq_free_cnt = (uint16_t)(txvq->vq_free_cnt - needed);\n-\tvq_ring_update_avail(txvq, head_idx);\n-\n-\treturn 0;\n-}\n-\n-static __rte_always_inline uint16_t\n-virtqueue_dequeue_burst(struct virtqueue *vq, struct rte_mbuf **rx_pkts, uint32_t *len, uint16_t num)\n-{\n-\tstruct vring_used_elem *uep;\n-\tstruct rte_mbuf *cookie;\n-\tuint16_t used_idx, desc_idx;\n-\tuint16_t i;\n-\t/*  Caller does the check */\n-\tfor (i = 0; i < num ; i ++) {\n-\t\tused_idx = (uint16_t)(vq->vq_used_cons_idx & (vq->vq_nentries - 1));\n-\t\tuep = &vq->vq_ring.used->ring[used_idx];\n-\t\tdesc_idx = (uint16_t) uep->id;\n-\t\tcookie = (struct rte_mbuf *)vq->vq_descx[desc_idx].cookie;\n-\t\tif (unlikely(cookie == NULL)) {\n-\t\t\tPMD_DRV_LOG(ERR, \"vring descriptor with no mbuf cookie at %u\\n\",\n-\t\t\t\tvq->vq_used_cons_idx);\n-\t\t\tRTE_LOG(ERR, PMD, \"%s: inconsistent (%u, %u)\\n\", __func__, used_idx , desc_idx);\n-\t\t\tbreak;\n-\t\t}\n-\t\tlen[i] = uep->len;\n-\t\trx_pkts[i]  = cookie;\n-\t\tvq->vq_used_cons_idx++;\n-\t\tvq_ring_free_chain(vq, desc_idx);\n-\t\tvq->vq_descx[desc_idx].cookie = NULL;\n-\t}\n-\treturn i;\n-}\n-\n-#endif /* _VIRTQUEUE_H_ */\ndiff --git a/mk/rte.app.mk b/mk/rte.app.mk\nindex c25fdd9..fb6be12 100644\n--- a/mk/rte.app.mk\n+++ b/mk/rte.app.mk\n@@ -144,7 +144,6 @@ ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y)\n _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VHOST)      += -lrte_pmd_vhost\n endif # $(CONFIG_RTE_LIBRTE_VHOST)\n _LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD)    += -lrte_pmd_vmxnet3_uio\n-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT)    += -lrte_pmd_xenvirt -lxenstore\n \n ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)\n _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB)    += -lrte_pmd_aesni_mb\ndiff --git a/pkg/dpdk.spec b/pkg/dpdk.spec\nindex 5ba3431..95c3335 100644\n--- a/pkg/dpdk.spec\n+++ b/pkg/dpdk.spec\n@@ -90,9 +90,6 @@ sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\\1y,' %{target}/.config\n sed -ri 's,(RTE_NEXT_ABI=).*,\\1n,'         %{target}/.config\n sed -ri 's,(LIBRTE_VHOST=).*,\\1y,'         %{target}/.config\n sed -ri 's,(LIBRTE_PMD_PCAP=).*,\\1y,'      %{target}/.config\n-%ifarch i686 x86_64\n-sed -ri 's,(LIBRTE_PMD_XENVIRT=).*,\\1y,'   %{target}/.config\n-%endif\n make O=%{target} %{?_smp_mflags}\n make O=%{target} doc\n \n",
    "prefixes": [
        "dpdk-dev",
        "2/6"
    ]
}