Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1132637/?format=api
{ "id": 1132637, "url": "http://patchwork.ozlabs.org/api/patches/1132637/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190716030637.5634-10-kevin.laatz@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20190716030637.5634-10-kevin.laatz@intel.com>", "list_archive_url": null, "date": "2019-07-16T03:06:36", "name": "[v2,09/10] samples/bpf: use hugepages in xdpsock app", "commit_ref": null, "pull_url": null, "state": "awaiting-upstream", "archived": false, "hash": "242f5639470e1051411142063d9582348040091b", "submitter": { "id": 76901, "url": "http://patchwork.ozlabs.org/api/people/76901/?format=api", "name": "Laatz, Kevin", "email": "kevin.laatz@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190716030637.5634-10-kevin.laatz@intel.com/mbox/", "series": [ { "id": 119750, "url": "http://patchwork.ozlabs.org/api/series/119750/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=119750", "date": "2019-07-16T03:06:28", "name": "[v2,01/10] i40e: simplify Rx buffer recycle", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/119750/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1132637/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1132637/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 45nyfd1tsvz9sN4\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 16 Jul 2019 21:22:17 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id DAB5D8600D;\n\tTue, 16 Jul 2019 11:22:15 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id PaIORdA6CIxg; Tue, 16 Jul 2019 11:22:15 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 63CB885FF3;\n\tTue, 16 Jul 2019 11:22:15 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id C5D4E1BF82D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Jul 2019 11:22:11 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id C31F385FF3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Jul 2019 11:22:11 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id bdJ8Ir9k3MPg for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Jul 2019 11:22:11 +0000 (UTC)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 4F98385CA8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Jul 2019 11:22:11 +0000 (UTC)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Jul 2019 04:22:11 -0700", "from silpixa00399838.ir.intel.com (HELO\n\tsilpixa00399838.ger.corp.intel.com) ([10.237.223.10])\n\tby fmsmga006.fm.intel.com with ESMTP; 16 Jul 2019 04:22:08 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.63,498,1557212400\"; d=\"scan'208\";a=\"366631625\"", "From": "Kevin Laatz <kevin.laatz@intel.com>", "To": "netdev@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,\n\tbjorn.topel@intel.com, magnus.karlsson@intel.com,\n\tjakub.kicinski@netronome.com, jonathan.lemon@gmail.com", "Date": "Tue, 16 Jul 2019 03:06:36 +0000", "Message-Id": "<20190716030637.5634-10-kevin.laatz@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190716030637.5634-1-kevin.laatz@intel.com>", "References": "<20190620090958.2135-1-kevin.laatz@intel.com>\n\t<20190716030637.5634-1-kevin.laatz@intel.com>", "Subject": "[Intel-wired-lan] [PATCH v2 09/10] samples/bpf: use hugepages in\n\txdpsock app", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Cc": "bruce.richardson@intel.com, ciara.loftus@intel.com,\n\tintel-wired-lan@lists.osuosl.org, bpf@vger.kernel.org,\n\tKevin Laatz <kevin.laatz@intel.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "This patch modifies xdpsock to use mmap instead of posix_memalign. With\nthis change, we can use hugepages when running the application in unaligned\nchunks mode. Using hugepages makes it more likely that we have physically\ncontiguous memory, which supports the unaligned chunk mode better.\n\nSigned-off-by: Kevin Laatz <kevin.laatz@intel.com>\n---\n samples/bpf/xdpsock_user.c | 15 ++++++++++-----\n 1 file changed, 10 insertions(+), 5 deletions(-)", "diff": "diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_user.c\nindex 8f220afd549a..958a27193582 100644\n--- a/samples/bpf/xdpsock_user.c\n+++ b/samples/bpf/xdpsock_user.c\n@@ -69,6 +69,7 @@ static int opt_poll;\n static int opt_interval = 1;\n static u32 opt_umem_flags;\n static int opt_unaligned_chunks;\n+static int opt_mmap_flags;\n static u32 opt_xdp_bind_flags;\n static int opt_xsk_frame_size = XSK_UMEM__DEFAULT_FRAME_SIZE;\n static __u32 prog_id;\n@@ -434,6 +435,7 @@ static void parse_command_line(int argc, char **argv)\n \t\tcase 'u':\n \t\t\topt_umem_flags |= XDP_UMEM_UNALIGNED_CHUNKS;\n \t\t\topt_unaligned_chunks = 1;\n+\t\t\topt_mmap_flags = MAP_HUGETLB;\n \t\t\tbreak;\n \t\tcase 'F':\n \t\t\topt_xdp_flags &= ~XDP_FLAGS_UPDATE_IF_NOEXIST;\n@@ -696,11 +698,14 @@ int main(int argc, char **argv)\n \t\texit(EXIT_FAILURE);\n \t}\n \n-\tret = posix_memalign(&bufs, getpagesize(), /* PAGE_SIZE aligned */\n-\t\t\t NUM_FRAMES * opt_xsk_frame_size);\n-\tif (ret)\n-\t\texit_with_error(ret);\n-\n+\t/* Reserve memory for the umem. Use hugepages if unaligned chunk mode */\n+\tbufs = mmap(NULL, NUM_FRAMES * opt_xsk_frame_size,\n+\t\t PROT_READ | PROT_WRITE,\n+\t\t MAP_PRIVATE | MAP_ANONYMOUS | opt_mmap_flags, -1, 0);\n+\tif (bufs == MAP_FAILED) {\n+\t\tprintf(\"ERROR: mmap failed\\n\");\n+\t\texit(EXIT_FAILURE);\n+\t}\n /* Create sockets... */\n \tumem = xsk_configure_umem(bufs, NUM_FRAMES * opt_xsk_frame_size);\n \txsks[num_socks++] = xsk_configure_socket(umem);\n", "prefixes": [ "v2", "09/10" ] }