Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/40980/?format=api
http://patchwork.dpdk.org/api/patches/40980/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/576536d9fee1d8029917deb526850bbb369680bd.1528716160.git.anatoly.burakov@intel.com/", "project": { "id": 1, "url": "http://patchwork.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": "<576536d9fee1d8029917deb526850bbb369680bd.1528716160.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/576536d9fee1d8029917deb526850bbb369680bd.1528716160.git.anatoly.burakov@intel.com", "date": "2018-06-11T16:13:33", "name": "[2/3] eal/bsdapp: concatenate adjacent segments", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "7acb8db89f2df67cc671df724c88077d5e5d3a6a", "submitter": { "id": 4, "url": "http://patchwork.dpdk.org/api/people/4/?format=api", "name": "Burakov, Anatoly", "email": "anatoly.burakov@intel.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/576536d9fee1d8029917deb526850bbb369680bd.1528716160.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 83, "url": "http://patchwork.dpdk.org/api/series/83/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=83", "date": "2018-06-11T16:13:33", "name": "[1/3] eal/bsdapp: fix segment index display", "version": 1, "mbox": "http://patchwork.dpdk.org/series/83/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/40980/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/40980/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 811A31E8B8;\n\tMon, 11 Jun 2018 18:13:40 +0200 (CEST)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 153681E8B8\n\tfor <dev@dpdk.org>; Mon, 11 Jun 2018 18:13:37 +0200 (CEST)", "from fmsmga007.fm.intel.com ([10.253.24.52])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Jun 2018 09:13:36 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga007.fm.intel.com with ESMTP; 11 Jun 2018 09:13:35 -0700", "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tw5BGDZfl007728; Mon, 11 Jun 2018 17:13:35 +0100", "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w5BGDZM2018888;\n\tMon, 11 Jun 2018 17:13:35 +0100", "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w5BGDZV5018884;\n\tMon, 11 Jun 2018 17:13:35 +0100" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.49,502,1520924400\"; d=\"scan'208\";a=\"46278376\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "Bruce Richardson <bruce.richardson@intel.com>", "Date": "Mon, 11 Jun 2018 17:13:33 +0100", "Message-Id": "<576536d9fee1d8029917deb526850bbb369680bd.1528716160.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": [ "<fd5598072a48e941be2f851b6286078b50e0c7b2.1528716160.git.anatoly.burakov@intel.com>", "<fd5598072a48e941be2f851b6286078b50e0c7b2.1528716160.git.anatoly.burakov@intel.com>" ], "References": [ "<fd5598072a48e941be2f851b6286078b50e0c7b2.1528716160.git.anatoly.burakov@intel.com>", "<fd5598072a48e941be2f851b6286078b50e0c7b2.1528716160.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [PATCH 2/3] eal/bsdapp: concatenate adjacent segments", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://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": "<https://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": "Previously, memory allocator always left holes between mapped\ncontigmem segments, even if they were IOVA-contiguous. Fix this\nby remembering last IOVA address and memseg index, and checking\nagainst those when mapping new contigmem segments.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/bsdapp/eal/eal_memory.c | 48 ++++++++++++++++----------\n 1 file changed, 30 insertions(+), 18 deletions(-)", "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c\nindex ca06de2f8..21a390fac 100644\n--- a/lib/librte_eal/bsdapp/eal/eal_memory.c\n+++ b/lib/librte_eal/bsdapp/eal/eal_memory.c\n@@ -104,6 +104,8 @@ rte_eal_hugepage_init(void)\n \t/* map all hugepages and sort them */\n \tfor (i = 0; i < internal_config.num_hugepage_sizes; i ++){\n \t\tstruct hugepage_info *hpi;\n+\t\trte_iova_t prev_end = 0;\n+\t\tint prev_ms_idx = -1;\n \t\tuint64_t page_sz, mem_needed;\n \t\tunsigned int n_pages, max_pages;\n \n@@ -124,10 +126,27 @@ rte_eal_hugepage_init(void)\n \t\t\tint error;\n \t\t\tsize_t sysctl_size = sizeof(physaddr);\n \t\t\tchar physaddr_str[64];\n+\t\t\tbool is_adjacent;\n+\n+\t\t\t/* first, check if this segment is IOVA-adjacent to\n+\t\t\t * the previous one.\n+\t\t\t */\n+\t\t\tsnprintf(physaddr_str, sizeof(physaddr_str),\n+\t\t\t\t\t\"hw.contigmem.physaddr.%d\", j);\n+\t\t\terror = sysctlbyname(physaddr_str, &physaddr,\n+\t\t\t\t\t&sysctl_size, NULL, 0);\n+\t\t\tif (error < 0) {\n+\t\t\t\tRTE_LOG(ERR, EAL, \"Failed to get physical addr for buffer %u \"\n+\t\t\t\t\t\t\"from %s\\n\", j, hpi->hugedir);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\n+\t\t\tis_adjacent = prev_end != 0 && physaddr == prev_end;\n+\t\t\tprev_end = physaddr + hpi->hugepage_sz;\n \n \t\t\tfor (msl_idx = 0; msl_idx < RTE_MAX_MEMSEG_LISTS;\n \t\t\t\t\tmsl_idx++) {\n-\t\t\t\tbool empty;\n+\t\t\t\tbool empty, need_hole;\n \t\t\t\tmsl = &mcfg->memsegs[msl_idx];\n \t\t\t\tarr = &msl->memseg_arr;\n \n@@ -136,20 +155,23 @@ rte_eal_hugepage_init(void)\n \n \t\t\t\tempty = arr->count == 0;\n \n-\t\t\t\t/* we need 1, plus hole if not empty */\n+\t\t\t\t/* we need a hole if this isn't an empty memseg\n+\t\t\t\t * list, and if previous segment was not\n+\t\t\t\t * adjacent to current one.\n+\t\t\t\t */\n+\t\t\t\tneed_hole = !empty && !is_adjacent;\n+\n+\t\t\t\t/* we need 1, plus hole if not adjacent */\n \t\t\t\tms_idx = rte_fbarray_find_next_n_free(arr,\n-\t\t\t\t\t\t0, 1 + (empty ? 1 : 0));\n+\t\t\t\t\t\t0, 1 + (need_hole ? 1 : 0));\n \n \t\t\t\t/* memseg list is full? */\n \t\t\t\tif (ms_idx < 0)\n \t\t\t\t\tcontinue;\n \n-\t\t\t\t/* leave some space between memsegs, they are\n-\t\t\t\t * not IOVA contiguous, so they shouldn't be VA\n-\t\t\t\t * contiguous either.\n-\t\t\t\t */\n-\t\t\t\tif (!empty)\n+\t\t\t\tif (need_hole && prev_ms_idx != ms_idx - 1)\n \t\t\t\t\tms_idx++;\n+\t\t\t\tprev_ms_idx = ms_idx;\n \n \t\t\t\tbreak;\n \t\t\t}\n@@ -178,16 +200,6 @@ rte_eal_hugepage_init(void)\n \t\t\t\treturn -1;\n \t\t\t}\n \n-\t\t\tsnprintf(physaddr_str, sizeof(physaddr_str), \"hw.contigmem\"\n-\t\t\t\t\t\".physaddr.%d\", j);\n-\t\t\terror = sysctlbyname(physaddr_str, &physaddr, &sysctl_size,\n-\t\t\t\t\tNULL, 0);\n-\t\t\tif (error < 0) {\n-\t\t\t\tRTE_LOG(ERR, EAL, \"Failed to get physical addr for buffer %u \"\n-\t\t\t\t\t\t\"from %s\\n\", j, hpi->hugedir);\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\n \t\t\tseg->addr = addr;\n \t\t\tseg->iova = physaddr;\n \t\t\tseg->hugepage_sz = page_sz;\n", "prefixes": [ "2/3" ] }{ "id": 40980, "url": "