From patchwork Thu Sep 14 02:40:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tan, Jianfeng" X-Patchwork-Id: 9952355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E71F8602C9 for ; Thu, 14 Sep 2017 02:42:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAB56287B1 for ; Thu, 14 Sep 2017 02:42:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE54A287C7; Thu, 14 Sep 2017 02:42:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1831B287B1 for ; Thu, 14 Sep 2017 02:42:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dsK43-0007lr-Sm; Thu, 14 Sep 2017 02:39:39 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dsK43-0007lO-3O for xen-devel@lists.xenproject.org; Thu, 14 Sep 2017 02:39:39 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id 54/73-03423-AEBE9B95; Thu, 14 Sep 2017 02:39:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRWlGSWpSXmKPExsXS1tYhovvy9c5 Ig86johbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bGxdsYC/5KVHRPPM3ewHhKtIuRi0NIYBqj xPJl29i6GDk5JAR4JY4sm8EKYftLPG+cChTnACoql1hxxAkkzCagLfFpVQ87iC0iICDxuXMxG 8gcZoFGJokdW74zg9QLC/hK3JugDFLDIqAq8Wv2DRYQm1fATWLDlt9Qq+Qkbp7rZAaxOQXcJb qfbWMEsYWAav7du8A2gZF3ASPDKkaN4tSistQiXUMTvaSizPSMktzEzBxdQwMzvdzU4uLE9NS cxKRiveT83E2MwGBgAIIdjNc3BhxilORgUhLl3au7M1KILyk/pTIjsTgjvqg0J7X4EKMMB4eS BC8nMLiEBItS01Mr0jJzgGEJk5bg4FES4d35CijNW1yQmFucmQ6ROsWoy9Fx8+4fJiGWvPy8V Clx3ncgRQIgRRmleXAjYDFyiVFWSpiXEegoIZ6C1KLczBJU+VeM4hyMSsK810Cm8GTmlcBteg V0BBPQEWdO7wA5oiQRISXVwKjn1/pv2vKHIn7TRe6sMEnwWXOZX/vZw4rfG/8UnRMu6r6jOW/ jJsaVWyf9N8k47eJ0W+TZ3ndJCtPnzz0ZUGFrnVBe9u3cM0kPU834qV4JGl2fT976/MJo3b79 p8Rz3rJKmk9n/iq6fbn6IsZjKx4fMxRVmqlhuTHltNT6bA678LmzvwbXNVkpsRRnJBpqMRcVJ wIAjkvWa4wCAAA= X-Env-Sender: jianfeng.tan@intel.com X-Msg-Ref: server-16.tower-27.messagelabs.com!1505356764!116321115!5 X-Originating-IP: [134.134.136.20] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzU1MzU4\n X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 800 invoked from network); 14 Sep 2017 02:39:36 -0000 Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 14 Sep 2017 02:39:36 -0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Sep 2017 19:39:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,390,1500966000"; d="scan'208";a="135148288" Received: from dpdk06.sh.intel.com ([10.67.110.196]) by orsmga002.jf.intel.com with ESMTP; 13 Sep 2017 19:39:33 -0700 From: Jianfeng Tan To: dev@dpdk.org Date: Thu, 14 Sep 2017 02:40:27 +0000 Message-Id: <1505356829-88652-5-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505356829-88652-1-git-send-email-jianfeng.tan@intel.com> References: <1505356829-88652-1-git-send-email-jianfeng.tan@intel.com> Cc: jerin.jacob@caviumnetworks.com, shahafs@mellanox.com, wei.liu2@citrix.com, bruce.richardson@intel.com, john.mcnamara@intel.com, Jianfeng Tan , thomas@monjalon.net, xen-devel@lists.xenproject.org, joao.m.martins@oracle.com Subject: [Xen-devel] [PATCH v2 4/6] xen: remove xen dependency in drivers, ether, mempool X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jianfeng Tan Acked-by: Bruce Richardson --- drivers/crypto/qat/qat_qp.c | 7 +------ drivers/net/i40e/i40e_rxtx.c | 8 ++------ lib/librte_ether/rte_ethdev.c | 7 +------ lib/librte_mempool/rte_mempool.c | 8 ++------ 4 files changed, 6 insertions(+), 24 deletions(-) diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c index 5048d21..34f75ca 100644 --- a/drivers/crypto/qat/qat_qp.c +++ b/drivers/crypto/qat/qat_qp.c @@ -122,14 +122,9 @@ queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size, break; default: memzone_flags = RTE_MEMZONE_SIZE_HINT_ONLY; -} -#ifdef RTE_LIBRTE_XEN_DOM0 - return rte_memzone_reserve_bounded(queue_name, queue_size, - socket_id, 0, RTE_CACHE_LINE_SIZE, RTE_PGSIZE_2M); -#else + } return rte_memzone_reserve_aligned(queue_name, queue_size, socket_id, memzone_flags, queue_size); -#endif } int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id, diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index d42c23c..f571e79 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -2221,12 +2221,8 @@ i40e_memzone_reserve(const char *name, uint32_t len, int socket_id) if (mz) return mz; - if (rte_xen_dom0_supported()) - mz = rte_memzone_reserve_bounded(name, len, - socket_id, 0, I40E_RING_BASE_ALIGN, RTE_PGSIZE_2M); - else - mz = rte_memzone_reserve_aligned(name, len, - socket_id, 0, I40E_RING_BASE_ALIGN); + mz = rte_memzone_reserve_aligned(name, len, + socket_id, 0, I40E_RING_BASE_ALIGN); return mz; } diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index a88916f..e8f7295 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -2835,12 +2835,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, if (mz) return mz; - if (rte_xen_dom0_supported()) - return rte_memzone_reserve_bounded(z_name, size, socket_id, - 0, align, RTE_PGSIZE_2M); - else - return rte_memzone_reserve_aligned(z_name, size, socket_id, - 0, align); + return rte_memzone_reserve_aligned(z_name, size, socket_id, 0, align); } int diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 6fc3c9c..6d726ae 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -527,11 +527,7 @@ rte_mempool_populate_default(struct rte_mempool *mp) if (mp->nb_mem_chunks != 0) return -EEXIST; - if (rte_xen_dom0_supported()) { - pg_sz = RTE_PGSIZE_2M; - pg_shift = rte_bsf32(pg_sz); - align = pg_sz; - } else if (rte_eal_has_hugepages()) { + if (rte_eal_has_hugepages()) { pg_shift = 0; /* not needed, zone is physically contiguous */ pg_sz = 0; align = RTE_CACHE_LINE_SIZE; @@ -568,7 +564,7 @@ rte_mempool_populate_default(struct rte_mempool *mp) else paddr = mz->phys_addr; - if (rte_eal_has_hugepages() && !rte_xen_dom0_supported()) + if (rte_eal_has_hugepages()) ret = rte_mempool_populate_phys(mp, mz->addr, paddr, mz->len, rte_mempool_memchunk_mz_free,