get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8506,
    "url": "https://patches.dpdk.org/api/patches/8506/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/5105036.dxuAVOzRX1@mentor/",
    "project": {
        "id": 1,
        "url": "https://patches.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": "<5105036.dxuAVOzRX1@mentor>",
    "list_archive_url": "https://inbox.dpdk.org/dev/5105036.dxuAVOzRX1@mentor",
    "date": "2015-11-01T12:06:55",
    "name": "[dpdk-dev] mbuf cleanup in i40e/ixgbe",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "155e292df70ec2fcd0ab841c84ed17e51342d6b3",
    "submitter": {
        "id": 368,
        "url": "https://patches.dpdk.org/api/people/368/?format=api",
        "name": "Evgeniy Marchenko",
        "email": "e.marchenko@ddos-guard.net"
    },
    "delegate": {
        "id": 10,
        "url": "https://patches.dpdk.org/api/users/10/?format=api",
        "username": "bruce",
        "first_name": "Bruce",
        "last_name": "Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/5105036.dxuAVOzRX1@mentor/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/8506/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/8506/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id E3B4E8E7D;\n\tSun,  1 Nov 2015 13:06:58 +0100 (CET)",
            "from mx3.ddos-guard.net (mx3.ddos-guard.net [190.115.16.1])\n\tby dpdk.org (Postfix) with ESMTP id 9EA158E7B\n\tfor <dev@dpdk.org>; Sun,  1 Nov 2015 13:06:57 +0100 (CET)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ddos-guard.net;\n\ts=ddos-guard; t=1446379617;\n\tbh=jUF9UtBQSM62lLW1LP38bR+00eENEmjo+z8gomBkam4=;\n\th=From:To:Subject:Date:From;\n\tb=LtXeoXntwuH8yaeK/1+pwQa0Qk52O2kUcj63e15Fl8DM6wPI5IgmzScJzLoWlU6Is\n\toEUaR4IiZm8o1wVAXUM2E7GIhBPITJIDm6gVw9Vx9yfsM4h1AzOcEkUbcG/mKPVN/Z\n\t3SIIQ46L4ck+hlIutHtX7z5hq7fKTU+3I1loK94c=",
        "From": "Evgeniy Marchenko <e.marchenko@ddos-guard.net>",
        "To": "dev@dpdk.org",
        "Date": "Sun, 01 Nov 2015 15:06:55 +0300",
        "Message-ID": "<5105036.dxuAVOzRX1@mentor>",
        "User-Agent": "KMail/5.0.2 (Linux/4.2.0-17-lowlatency; KDE/5.15.0; x86_64; ; )",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "7Bit",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Subject": "[dpdk-dev] mbuf cleanup in i40e/ixgbe",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://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": "<http://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": "Hello\n\nI'm checking mbuf consumption issues in TX path and it looks like i40e and \nixgbe drivers consume all mbufs in \"full featured\" path and free them one-by-\none only after TX queue wraps.\n\nUpstream drivers are more conservative with memory consumption and free up to \n256 SKBs on every napi_poll invocation. And this makes sense because there is \nindeed not too much work for cleanup and freeing as much memory buffers as \npossible would lower memory pressure and memory requirements and allow bigger \nTX bursts without cleanup procedures and better CPU cache utilization.\n\nWhy cannot we bulk free mbuf in i40e_xmit_cleanup ? Why do we need \nnb_tx_to_clean calculations? Isn't it always equal to txq->tx_rs_thresh?\n\nHere is a proposed patch for i40e PMD to bulk free unused mbufs:\n\n----------------------------------- CUT --------------------------------------\n----------------------------------- CUT --------------------------------------\n\nWhat do you think about cleaning not just txq->tx_rs_thresh mbufs but as many \nas possible?\n\nRegards, Evgeniy Marchenko\nDDoS-Guard.net",
    "diff": "diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c\nindex 8731712..9e3a333 100644\n--- a/drivers/net/i40e/i40e_rxtx.c\n+++ b/drivers/net/i40e/i40e_rxtx.c\n@@ -883,8 +883,12 @@ i40e_xmit_cleanup(struct i40e_tx_queue *txq)\n        uint16_t nb_tx_desc = txq->nb_tx_desc;\n        uint16_t desc_to_clean_to;\n        uint16_t nb_tx_to_clean;\n+       struct i40e_tx_entry *txe;\n+       int i;\n \n-       desc_to_clean_to = (uint16_t)(last_desc_cleaned + txq->tx_rs_thresh);\n+       nb_tx_to_clean = txq->tx_rs_thresh;\n+\n+       desc_to_clean_to = (uint16_t)(last_desc_cleaned + nb_tx_to_clean);\n        if (desc_to_clean_to >= nb_tx_desc)\n                desc_to_clean_to = (uint16_t)(desc_to_clean_to - nb_tx_desc);\n \n@@ -898,12 +902,18 @@ i40e_xmit_cleanup(struct i40e_tx_queue *txq)\n                return -1;\n        }\n \n-       if (last_desc_cleaned > desc_to_clean_to)\n-               nb_tx_to_clean = (uint16_t)((nb_tx_desc - last_desc_cleaned) +\n-                                                       desc_to_clean_to);\n-       else\n-               nb_tx_to_clean = (uint16_t)(desc_to_clean_to -\n-                                       last_desc_cleaned);\n+       i = last_desc_cleaned;\n+       while (i++ != desc_to_clean_to) {\n+               if (i >= nb_tx_desc)\n+                       i -= nb_tx_desc;\n+\n+               txe = &sw_ring[i];\n+               RTE_MBUF_PREFETCH_TO_FREE(txe->mbuf);\n+               if (txe->mbuf) {\n+                       rte_pktmbuf_free_seg(txe->mbuf);\n+                       txe->mbuf = NULL;\n+               }\n+       }\n \n        txd[desc_to_clean_to].cmd_type_offset_bsz = 0;\n \n",
    "prefixes": [
        "dpdk-dev"
    ]
}