Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/744426/?format=api
{ "id": 744426, "url": "http://patchwork.ozlabs.org/api/patches/744426/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170328164703.12688.90760.stgit@john-Precision-Tower-5810/", "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": "<20170328164703.12688.90760.stgit@john-Precision-Tower-5810>", "list_archive_url": null, "date": "2017-03-28T16:47:03", "name": "ixgbe: delay tail write to every 'n' packets", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "635d62bac1743a1a770d5b71d9e956c5e9753942", "submitter": { "id": 20028, "url": "http://patchwork.ozlabs.org/api/people/20028/?format=api", "name": "John Fastabend", "email": "john.fastabend@gmail.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/20170328164703.12688.90760.stgit@john-Precision-Tower-5810/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/744426/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/744426/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.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" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3vsxdM3JrGz9s2Q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 29 Mar 2017 03:47:19 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id C84B78935A;\n\tTue, 28 Mar 2017 16:47:17 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id ImhrhX-IBhOL; Tue, 28 Mar 2017 16:47:16 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id DFD10891AD;\n\tTue, 28 Mar 2017 16:47:16 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 1FE841C0018\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 28 Mar 2017 16:47:16 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 1BDD389505\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 28 Mar 2017 16:47:16 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 7AY0wzxye75k for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 28 Mar 2017 16:47:15 +0000 (UTC)", "from mail-pg0-f67.google.com (mail-pg0-f67.google.com\n\t[74.125.83.67])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 6DBD0894B2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 28 Mar 2017 16:47:15 +0000 (UTC)", "by mail-pg0-f67.google.com with SMTP id 81so22592826pgh.3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 28 Mar 2017 09:47:15 -0700 (PDT)", "from [127.0.1.1] ([72.168.144.120])\n\tby smtp.gmail.com with ESMTPSA id\n\tz25sm8539770pfi.28.2017.03.28.09.47.09\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 28 Mar 2017 09:47:14 -0700 (PDT)" ], "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"fG+A/VLz\"; dkim-atps=neutral", "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:subject:to:cc:date:message-id:user-agent:mime-version\n\t:content-transfer-encoding;\n\tbh=f8hECmSugSF4GS6RJJlsO/mdBQG65bWuq2X9jRbN5WY=;\n\tb=fG+A/VLzH6tzhmv9OwhbC7xaX0LOWvfeAw2KptR2MzdojnDnDkM2ZSW6eXGESa7+Ye\n\trjJdAfUwSNq5vUOkWufv7/VOolYse+qNKy9syd6e4uZ6CpJu6IkLHEQFDt2ffD3o4Wa8\n\tJuqwJpIdyNgaUp33iDSZWV1cFjGQG4vxyDI/PkrqYt0V+NeLh6cpaetSsczxq9REq3Kl\n\tuYYs3gtNXaHedRDLIMSZ6RihkhbR6rgTRKxikBDejD1liWkGOfhs8JXnYYTBIUyYax6/\n\tx9scYxyxEABykvoKo0hKa0uFTqBehK86bS2oXUDYS27X1hXFWZA9nbY4bFRhLuTc5dhq\n\tCVtA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:subject:to:cc:date:message-id:user-agent\n\t:mime-version:content-transfer-encoding;\n\tbh=f8hECmSugSF4GS6RJJlsO/mdBQG65bWuq2X9jRbN5WY=;\n\tb=WvnW6ABZYpopkUi+4AnaYpU8v0KDSQucL6TuygYpAJqe6Jz2hQxHCP5HLqgfz3v8Av\n\taRR3YpTApRK3Hu1DYwtHVjbxyZpUcGeLjWy51fLOqQK/26MysGKU574s8PtBQYvYdtdl\n\tgBio6Cn22qrkNBktDSvYGUCNVt9wcfaZNZoxxC73HxlC4umBVyTnXujOrTGw6qdrpy4s\n\tQykU4l4kx7VK/QU7zti1fx2y64AGE4ovCK0hVY+XFY5ffD+mTm54geQvC2k6bM+uA9Ia\n\tqWyWOqq//QHmpOF8v4h+L1/CIS3moWlTC0rICMgQrSStPmo47Z20A5ScTodb01YYY9z5\n\t9PPw==", "X-Gm-Message-State": "AFeK/H0BgSDKsHZM+SOLj8OQSclJGUJfgWmzNYXt0wmGPNgIemMqtfO2n+WvKWtjpm7X4A==", "X-Received": "by 10.98.108.196 with SMTP id\n\th187mr32843493pfc.233.1490719635000; \n\tTue, 28 Mar 2017 09:47:15 -0700 (PDT)", "From": "John Fastabend <john.fastabend@gmail.com>", "X-Google-Original-From": "John Fastabend <john.r.fastabend@intel.com>", "To": "john.fastabend@gmail.com, alexander.duyck@gmail.com", "Date": "Tue, 28 Mar 2017 09:47:03 -0700", "Message-ID": "<20170328164703.12688.90760.stgit@john-Precision-Tower-5810>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Cc": "intel-wired-lan@lists.osuosl.org, u9012063@gmail.com", "Subject": "[Intel-wired-lan] [PATCH] ixgbe: delay tail write to every 'n'\n\tpackets", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "Current XDP implementation hits the tail on every XDP_TX return\ncode. This patch changes driver behavior to only hit the tail after\npacket processing is complete.\n\nWith this patch I can run XDP drop programs @ 14+Mpps and XDP_TX\nprograms are at ~13.5Mpps.\n\nSigned-off-by: John Fastabend <john.r.fastabend@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 28 +++++++++++++++----------\n 1 file changed, 17 insertions(+), 11 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex cd7eefd..750b204 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -2284,6 +2284,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,\n \tunsigned int mss = 0;\n #endif /* IXGBE_FCOE */\n \tu16 cleaned_count = ixgbe_desc_unused(rx_ring);\n+\tbool xdp_xmit = false;\n \n \twhile (likely(total_rx_packets < budget)) {\n \t\tunion ixgbe_adv_rx_desc *rx_desc;\n@@ -2323,10 +2324,12 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,\n \t\t}\n \n \t\tif (IS_ERR(skb)) {\n-\t\t\tif (PTR_ERR(skb) == -IXGBE_XDP_TX)\n+\t\t\tif (PTR_ERR(skb) == -IXGBE_XDP_TX) {\n+\t\t\t\txdp_xmit = true;\n \t\t\t\tixgbe_rx_buffer_flip(rx_ring, rx_buffer, size);\n-\t\t\telse\n+\t\t\t} else {\n \t\t\t\trx_buffer->pagecnt_bias++;\n+\t\t\t}\n \t\t\ttotal_rx_packets++;\n \t\t\ttotal_rx_bytes += size;\n \t\t} else if (skb) {\n@@ -2394,6 +2397,16 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,\n \t\ttotal_rx_packets++;\n \t}\n \n+\tif (xdp_xmit) {\n+\t\tstruct ixgbe_ring *ring = adapter->xdp_ring[smp_processor_id()];\n+\n+\t\t/* Force memory writes to complete before letting h/w\n+\t\t * know there are new descriptors to fetch.\n+\t\t */\n+\t\twmb();\n+\t\twritel(ring->next_to_use, ring->tail);\n+\t}\n+\n \tu64_stats_update_begin(&rx_ring->syncp);\n \trx_ring->stats.packets += total_rx_packets;\n \trx_ring->stats.bytes += total_rx_bytes;\n@@ -8239,14 +8252,8 @@ static int ixgbe_xmit_xdp_ring(struct ixgbe_adapter *adapter,\n \ttx_desc->read.olinfo_status =\n \t\tcpu_to_le32(len << IXGBE_ADVTXD_PAYLEN_SHIFT);\n \n-\t/* Force memory writes to complete before letting h/w know there\n-\t * are new descriptors to fetch. (Only applicable for weak-ordered\n-\t * memory model archs, such as IA-64).\n-\t *\n-\t * We also need this memory barrier to make certain all of the\n-\t * status bits have been updated before next_to_watch is written.\n-\t */\n-\twmb();\n+\t/* Avoid any potential race with xdp_xmit and cleanup */\n+\tsmp_wmb();\n \n \t/* set next_to_watch value indicating a packet is present */\n \ti++;\n@@ -8256,7 +8263,6 @@ static int ixgbe_xmit_xdp_ring(struct ixgbe_adapter *adapter,\n \ttx_buffer->next_to_watch = tx_desc;\n \tring->next_to_use = i;\n \n-\twritel(i, ring->tail);\n \treturn IXGBE_XDP_TX;\n }\n \n", "prefixes": [] }