get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 85483,
    "url": "https://patches.dpdk.org/api/patches/85483/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1608311697-31529-2-git-send-email-viacheslavo@nvidia.com/",
    "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": "<1608311697-31529-2-git-send-email-viacheslavo@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1608311697-31529-2-git-send-email-viacheslavo@nvidia.com",
    "date": "2020-12-18T17:14:56",
    "name": "[1/2] net/mlx5: optimize inline mbuf freeing",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d55edb4713c21f84ca2b02c794877c6788eca045",
    "submitter": {
        "id": 1926,
        "url": "https://patches.dpdk.org/api/people/1926/?format=api",
        "name": "Slava Ovsiienko",
        "email": "viacheslavo@nvidia.com"
    },
    "delegate": {
        "id": 3268,
        "url": "https://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1608311697-31529-2-git-send-email-viacheslavo@nvidia.com/mbox/",
    "series": [
        {
            "id": 14380,
            "url": "https://patches.dpdk.org/api/series/14380/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14380",
            "date": "2020-12-18T17:14:55",
            "name": "net/mlx5: add mbuf fast free Tx offload",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/14380/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/85483/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/85483/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 5743FA09FD;\n\tFri, 18 Dec 2020 18:15:43 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DAE6CCB12;\n\tFri, 18 Dec 2020 18:15:08 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id A9D5FCAFF\n for <dev@dpdk.org>; Fri, 18 Dec 2020 18:15:05 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n viacheslavo@nvidia.com) with SMTP; 18 Dec 2020 19:15:00 +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 0BIHEwIR006669;\n Fri, 18 Dec 2020 19:14:59 +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, stable@dpdk.org",
        "Date": "Fri, 18 Dec 2020 17:14:56 +0000",
        "Message-Id": "<1608311697-31529-2-git-send-email-viacheslavo@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1608311697-31529-1-git-send-email-viacheslavo@nvidia.com>",
        "References": "<1608311697-31529-1-git-send-email-viacheslavo@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH 1/2] net/mlx5: optimize inline mbuf freeing",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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 d12d746..e8c8783 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.c\n+++ b/drivers/net/mlx5/mlx5_rxtx.c\n@@ -1940,6 +1940,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@@ -4392,10 +4403,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@@ -4417,6 +4443,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@@ -4426,7 +4453,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@@ -4880,6 +4906,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@@ -5143,6 +5171,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 7989a50..fc5cc2e 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.h\n+++ b/drivers/net/mlx5/mlx5_rxtx.h\n@@ -217,6 +217,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": [
        "1/2"
    ]
}