From patchwork Wed Aug 30 18:10:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tan, Jianfeng" X-Patchwork-Id: 9930489 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 961FA6022E for ; Wed, 30 Aug 2017 18:12:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EB222874E for ; Wed, 30 Aug 2017 18:12:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8352928750; Wed, 30 Aug 2017 18:12: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 E5D9F2874B for ; Wed, 30 Aug 2017 18:12: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 1dn7R2-000799-4b; Wed, 30 Aug 2017 18:09:52 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dn7R1-00077C-DA for xen-devel@lists.xenproject.org; Wed, 30 Aug 2017 18:09:51 +0000 Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id 7E/EF-01777-E6FF6A95; Wed, 30 Aug 2017 18:09:50 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPLMWRWlGSWpSXmKPExsVywNwkVjf3/7J Ig8nvdC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozD8/6zFxyVqLj0+iZ7A+M00S5GLg4hgWmM Eu0HFjN3MXJySAjwShxZNoMVwvaXuD7pEVhcSKBc4sH/HhYQm01AW+LTqh52EFtEQEDic+diN pBBzAJnGSW+LX8DlhAW8JL4v2wZG4jNIqAq8Xn9NDCbV8Bd4s5niEESAnISN891gi3gFPCQ6L 67BmqZu8Tte9uYJzDyLmBkWMWoUZxaVJZapGtsoJdUlJmeUZKbmJmja2hgqpebWlycmJ6ak5h UrJecn7uJERgQ9QwMjDsYJ6zyO8QoycGkJMpr8WtZpBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ Xul/QDnBotT01Iq0zBxgaMKkJTh4lER4I0DSvMUFibnFmekQqVOMilLivN/+AiUEQBIZpXlwb bB4uMQoKyXMy8jAwCDEU5BalJtZgir/ilGcg1FJGGI8T2ZeCdz0V0CLmYAWx3otBVlckoiQkm pgjDvBtFHixA7bY+wvGXbFHOWJztgjnrvCNDPw7h+DtToBPRdnSLXl9Px3suSf6+4eLHtUTqN CWvDQJCu/mXKlk//MUHnj37H2mOWOju3lHrL8Se4NV6RWcfV3Xj4+r2DKtE8z/9y3nFmz6aXF ZseIrb2fXuyN7pzdNi0s9iRjO4vxu39PPVn7lViKMxINtZiLihMBSnf9sIICAAA= X-Env-Sender: jianfeng.tan@intel.com X-Msg-Ref: server-14.tower-206.messagelabs.com!1504116581!70786327!5 X-Originating-IP: [192.55.52.93] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDMyNDY2NQ==\n X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 62792 invoked from network); 30 Aug 2017 18:09:49 -0000 Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 30 Aug 2017 18:09:49 -0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Aug 2017 11:09:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,449,1498546800"; d="scan'208";a="130029491" Received: from dpdk06.sh.intel.com ([10.67.110.196]) by orsmga002.jf.intel.com with ESMTP; 30 Aug 2017 11:09:46 -0700 From: Jianfeng Tan To: dev@dpdk.org Date: Wed, 30 Aug 2017 18:10:32 +0000 Message-Id: <1504116634-115687-5-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> Cc: jerin.jacob@caviumnetworks.com, shahafs@mellanox.com, john.mcnamara@intel.com, Jianfeng Tan , oao.m.martins@oracle.com, thomas@monjalon.net, xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH 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 0597641..cb0bde7 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -2818,12 +2818,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,