get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87102,
    "url": "http://patches.dpdk.org/api/patches/87102/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1611335529-26503-2-git-send-email-viacheslavo@nvidia.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<1611335529-26503-2-git-send-email-viacheslavo@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1611335529-26503-2-git-send-email-viacheslavo@nvidia.com",
    "date": "2021-01-22T17:12:08",
    "name": "[v3,1/2] net/mlx5: optimize inline mbuf freeing",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "d55edb4713c21f84ca2b02c794877c6788eca045",
    "submitter": {
        "id": 1926,
        "url": "http://patches.dpdk.org/api/people/1926/?format=api",
        "name": "Slava Ovsiienko",
        "email": "viacheslavo@nvidia.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1611335529-26503-2-git-send-email-viacheslavo@nvidia.com/mbox/",
    "series": [
        {
            "id": 14907,
            "url": "http://patches.dpdk.org/api/series/14907/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=14907",
            "date": "2021-01-22T17:12:07",
            "name": "add mbuf fast free offload support",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/14907/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/87102/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/87102/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3EC74A0A0A;\n\tFri, 22 Jan 2021 18:12:22 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1024C141040;\n\tFri, 22 Jan 2021 18:12:20 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by mails.dpdk.org (Postfix) with ESMTP id 53F3E14103C\n for <dev@dpdk.org>; Fri, 22 Jan 2021 18:12:18 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n viacheslavo@nvidia.com) with SMTP; 22 Jan 2021 19:12:13 +0200",
            "from nvidia.com (pegasus12.mtr.labs.mlnx [10.210.17.40])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 10MHCCue025286;\n Fri, 22 Jan 2021 19:12:13 +0200"
        ],
        "From": "Viacheslav Ovsiienko <viacheslavo@nvidia.com>",
        "To": "dev@dpdk.org",
        "Cc": "rasland@nvidia.com, matan@nvidia.com, orika@nvidia.com,\n thomas@monjalon.net, akozyrev@nvidia.com, stable@dpdk.org",
        "Date": "Fri, 22 Jan 2021 17:12:08 +0000",
        "Message-Id": "<1611335529-26503-2-git-send-email-viacheslavo@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1611335529-26503-1-git-send-email-viacheslavo@nvidia.com>",
        "References": "<1608311697-31529-1-git-send-email-viacheslavo@nvidia.com>\n <1611335529-26503-1-git-send-email-viacheslavo@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH v3 1/2] net/mlx5: optimize inline mbuf freeing",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The mlx5 PMD supports packet data inlining by pushing data\nto the transmit descriptor. If packet is short enough and all\ndata are inline, the mbuf is not needed for data send anymore\nand can be freed.\n\nThe mbuf free was performed in the most inner loop building\nthe transmit descriptors. This patch postpones the mbuf free\ntransaction to the tx_burst routine exit, optimizing the loop\nand allowing the bulk freeing for the multiple mbufs in single\npool API call.\n\nCc: stable@dpdk.org\n\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>\n---\n drivers/net/mlx5/mlx5_rxtx.c | 38 ++++++++++++++++++++++++++++++++++----\n drivers/net/mlx5/mlx5_rxtx.h |  1 +\n 2 files changed, 35 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c\nindex 3497765..97912dd 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.c\n+++ b/drivers/net/mlx5/mlx5_rxtx.c\n@@ -1990,6 +1990,17 @@ enum mlx5_txcmp_code {\n \t\t}\n \t}\n }\n+/*\n+ * No inline version to free buffers for optimal call\n+ * on the tx_burst completion.\n+ */\n+static __rte_noinline void\n+__mlx5_tx_free_mbuf(struct rte_mbuf **__rte_restrict pkts,\n+\t\t    unsigned int pkts_n,\n+\t\t    unsigned int olx __rte_unused)\n+{\n+\tmlx5_tx_free_mbuf(pkts, pkts_n, olx);\n+}\n \n /**\n  * Free the mbuf from the elts ring buffer till new tail.\n@@ -4408,10 +4419,25 @@ enum mlx5_txcmp_code {\n \t\t\tMLX5_ASSERT(room >= tlen);\n \t\t\troom -= tlen;\n \t\t\t/*\n-\t\t\t * Packet data are completely inlined,\n-\t\t\t * free the packet immediately.\n+\t\t\t * Packet data are completely inline,\n+\t\t\t * we can try to free the packet.\n+\t\t\t */\n+\t\t\tif (likely(loc->pkts_sent == loc->mbuf_free)) {\n+\t\t\t\t/*\n+\t\t\t\t * All the packets from the burst beginning\n+\t\t\t\t * are inline, we can free mbufs directly\n+\t\t\t\t * from the origin array on tx_burst exit().\n+\t\t\t\t */\n+\t\t\t\tloc->mbuf_free++;\n+\t\t\t\tgoto next_mbuf;\n+\t\t\t}\n+\t\t\t/*\n+\t\t\t * In order no to call rte_pktmbuf_free_seg() here,\n+\t\t\t * in the most inner loop (that might be very\n+\t\t\t * expensive) we just save the mbuf in elts.\n \t\t\t */\n-\t\t\trte_pktmbuf_free_seg(loc->mbuf);\n+\t\t\ttxq->elts[txq->elts_head++ & txq->elts_m] = loc->mbuf;\n+\t\t\tloc->elts_free--;\n \t\t\tgoto next_mbuf;\n pointer_empw:\n \t\t\t/*\n@@ -4433,6 +4459,7 @@ enum mlx5_txcmp_code {\n \t\t\tmlx5_tx_dseg_ptr(txq, loc, dseg, dptr, dlen, olx);\n \t\t\t/* We have to store mbuf in elts.*/\n \t\t\ttxq->elts[txq->elts_head++ & txq->elts_m] = loc->mbuf;\n+\t\t\tloc->elts_free--;\n \t\t\troom -= MLX5_WQE_DSEG_SIZE;\n \t\t\t/* Ring buffer wraparound is checked at the loop end.*/\n \t\t\t++dseg;\n@@ -4442,7 +4469,6 @@ enum mlx5_txcmp_code {\n \t\t\tslen += dlen;\n #endif\n \t\t\tloc->pkts_sent++;\n-\t\t\tloc->elts_free--;\n \t\t\tpkts_n--;\n \t\t\tif (unlikely(!pkts_n || !loc->elts_free)) {\n \t\t\t\t/*\n@@ -4892,6 +4918,8 @@ enum mlx5_txcmp_code {\n \tMLX5_ASSERT(txq->wqe_s >= (uint16_t)(txq->wqe_ci - txq->wqe_pi));\n \tif (unlikely(!pkts_n))\n \t\treturn 0;\n+\tif (MLX5_TXOFF_CONFIG(INLINE))\n+\t\tloc.mbuf_free = 0;\n \tloc.pkts_sent = 0;\n \tloc.pkts_copy = 0;\n \tloc.wqe_last = NULL;\n@@ -5155,6 +5183,8 @@ enum mlx5_txcmp_code {\n \t/* Increment sent packets counter. */\n \ttxq->stats.opackets += loc.pkts_sent;\n #endif\n+\tif (MLX5_TXOFF_CONFIG(INLINE) && loc.mbuf_free)\n+\t\t__mlx5_tx_free_mbuf(pkts, loc.mbuf_free, olx);\n \treturn loc.pkts_sent;\n }\n \ndiff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h\nindex 7756ed3..9dac408 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.h\n+++ b/drivers/net/mlx5/mlx5_rxtx.h\n@@ -209,6 +209,7 @@ struct mlx5_txq_local {\n \tuint16_t wqe_free; /* available wqe remain. */\n \tuint16_t mbuf_off; /* data offset in current mbuf. */\n \tuint16_t mbuf_nseg; /* number of remaining mbuf. */\n+\tuint16_t mbuf_free; /* number of inline mbufs to free. */\n };\n \n /* TX queue descriptor. */\n",
    "prefixes": [
        "v3",
        "1/2"
    ]
}