get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1122929/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1122929,
    "url": "http://patchwork.ozlabs.org/api/patches/1122929/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190626092027.52845-8-anthony.l.nguyen@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": "<20190626092027.52845-8-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2019-06-26T09:20:19",
    "name": "[S22,08/16] ice: Only bump Rx tail and release buffers once per napi_poll",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "e6484a7ff33075e011fab4f1e7a90f3ccbe4ff8e",
    "submitter": {
        "id": 68875,
        "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api",
        "name": "Tony Nguyen",
        "email": "anthony.l.nguyen@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/20190626092027.52845-8-anthony.l.nguyen@intel.com/mbox/",
    "series": [
        {
            "id": 116295,
            "url": "http://patchwork.ozlabs.org/api/series/116295/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=116295",
            "date": "2019-06-26T09:20:14",
            "name": "[S22,01/16] ice: add lp_advertising flow control support",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/116295/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1122929/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1122929/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 45Yr8z2m6Bz9s4V\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 27 Jun 2019 03:48:03 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 03D218618F;\n\tWed, 26 Jun 2019 17:48:02 +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 XInWXp95yJnE; Wed, 26 Jun 2019 17:48:00 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id EAF42861C8;\n\tWed, 26 Jun 2019 17:47:59 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id DBDA51BF326\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 26 Jun 2019 17:47:55 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id D6C81860FC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 26 Jun 2019 17:47:55 +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 7OmCbJ9GgYK5 for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 26 Jun 2019 17:47:53 +0000 (UTC)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id E0F9685E25\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 26 Jun 2019 17:47:52 +0000 (UTC)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Jun 2019 10:47:52 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby fmsmga001.fm.intel.com with ESMTP; 26 Jun 2019 10:47:52 -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,420,1557212400\"; d=\"scan'208\";a=\"183218130\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 26 Jun 2019 02:20:19 -0700",
        "Message-Id": "<20190626092027.52845-8-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190626092027.52845-1-anthony.l.nguyen@intel.com>",
        "References": "<20190626092027.52845-1-anthony.l.nguyen@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH S22 08/16] ice: Only bump Rx tail and\n\trelease buffers once per napi_poll",
        "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": "Brett Creeley <brett.creeley@intel.com>",
        "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": "From: Brett Creeley <brett.creeley@intel.com>\n\nCurrently we bump the Rx tail and release/give buffers to hardware every\n16 descriptors. This causes us to bump Rx tail up to 4 times per\nnapi_poll call. Also we are always bumping tail on an odd index and this\nis a problem because hardware ignores the lower 3 bits in the QRX_TAIL\nregister. This is making it so hardware sees tail bumps only every 8\ndescriptors. Instead lets only bump Rx tail once per napi_poll if\nthe value aligns with hardwares expectations of the lower 3 bits being\ncleared. Also only release/give Rx buffers once per napi_poll call.\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_txrx.c | 41 +++++++++++++++--------\n 1 file changed, 27 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c\nindex d76237d82009..c604b2d192b1 100644\n--- a/drivers/net/ethernet/intel/ice/ice_txrx.c\n+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c\n@@ -428,18 +428,28 @@ static\n #endif\n void ice_release_rx_desc(struct ice_ring *rx_ring, u32 val)\n {\n+\tu16 prev_ntu = rx_ring->next_to_use;\n+\n \trx_ring->next_to_use = val;\n \n \t/* update next to alloc since we have filled the ring */\n \trx_ring->next_to_alloc = val;\n \n-\t/* Force memory writes to complete before letting h/w\n-\t * know there are new descriptors to fetch. (Only\n-\t * applicable for weak-ordered memory model archs,\n-\t * such as IA-64).\n+\t/* QRX_TAIL will be updated with any tail value, but hardware ignores\n+\t * the lower 3 bits. This makes it so we only bump tail on meaningful\n+\t * boundaries. Also, this allows us to bump tail on intervals of 8 up to\n+\t * the budget depending on the current traffic load.\n \t */\n-\twmb();\n-\twritel(val, rx_ring->tail);\n+\tval &= ~0x7;\n+\tif (prev_ntu != val) {\n+\t\t/* Force memory writes to complete before letting h/w\n+\t\t * know there are new descriptors to fetch. (Only\n+\t\t * applicable for weak-ordered memory model archs,\n+\t\t * such as IA-64).\n+\t\t */\n+\t\twmb();\n+\t\twritel(val, rx_ring->tail);\n+\t}\n }\n \n /**\n@@ -697,7 +707,13 @@ ice_alloc_mapped_page(struct ice_ring *rx_ring, struct ice_rx_buf *bi)\n  * @rx_ring: ring to place buffers on\n  * @cleaned_count: number of buffers to replace\n  *\n- * Returns false if all allocations were successful, true if any fail\n+ * Returns false if all allocations were successful, true if any fail. Returning\n+ * true signals to the caller that we didn't replace cleaned_count buffers and\n+ * there is more work to do.\n+ *\n+ * First, try to clean \"cleaned_count\" Rx buffers. Then refill the cleaned Rx\n+ * buffers. Then bump tail at most one time. Grouping like this lets us avoid\n+ * multiple tail writes per call.\n  */\n bool ice_alloc_rx_bufs(struct ice_ring *rx_ring, u16 cleaned_count)\n {\n@@ -1253,8 +1269,8 @@ static int ice_clean_rx_irq(struct ice_ring *rx_ring, int budget)\n \tu16 cleaned_count = ICE_DESC_UNUSED(rx_ring);\n \tunsigned int xdp_res, xdp_xmit = 0;\n \tstruct bpf_prog *xdp_prog;\n-\tbool failure = false;\n \tstruct xdp_buff xdp;\n+\tbool failure;\n \n \txdp.rxq = &rx_ring->xdp_rxq;\n \n@@ -1268,12 +1284,6 @@ static int ice_clean_rx_irq(struct ice_ring *rx_ring, int budget)\n \t\tu16 vlan_tag = 0;\n \t\tu8 rx_ptype;\n \n-\t\t/* return some buffers to hardware, one at a time is too slow */\n-\t\tif (cleaned_count >= ICE_RX_BUF_WRITE) {\n-\t\t\tfailure = failure ||\n-\t\t\t\t  ice_alloc_rx_bufs(rx_ring, cleaned_count);\n-\t\t\tcleaned_count = 0;\n-\t\t}\n \n \t\t/* get the Rx desc from Rx ring based on 'next_to_clean' */\n \t\trx_desc = ICE_RX_DESC(rx_ring, rx_ring->next_to_clean);\n@@ -1385,6 +1395,9 @@ static int ice_clean_rx_irq(struct ice_ring *rx_ring, int budget)\n \t\ttotal_rx_pkts++;\n \t}\n \n+\t/* return up to cleaned_count buffers to hardware */\n+\tfailure = ice_alloc_rx_bufs(rx_ring, cleaned_count);\n+\n \tice_finalize_xdp_rx(rx_ring, xdp_xmit);\n \n \t/* update queue and vector specific stats */\n",
    "prefixes": [
        "S22",
        "08/16"
    ]
}