get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57234,
    "url": "http://patches.dpdk.org/api/patches/57234/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1564401209-18752-5-git-send-email-matan@mellanox.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": "<1564401209-18752-5-git-send-email-matan@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1564401209-18752-5-git-send-email-matan@mellanox.com",
    "date": "2019-07-29T11:53:22",
    "name": "[04/11] net/mlx5: support mbuf headroom for LRO packet",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "69ed252ba3e97eac3a28abb867fa90eab7dafd27",
    "submitter": {
        "id": 796,
        "url": "http://patches.dpdk.org/api/people/796/?format=api",
        "name": "Matan Azrad",
        "email": "matan@mellanox.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/1564401209-18752-5-git-send-email-matan@mellanox.com/mbox/",
    "series": [
        {
            "id": 5809,
            "url": "http://patches.dpdk.org/api/series/5809/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5809",
            "date": "2019-07-29T11:53:21",
            "name": "net/mlx5: LRO fixes and enhancements",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/5809/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/57234/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/57234/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DE4D01BF8E;\n\tMon, 29 Jul 2019 14:16:51 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id 5E39D1BF5B\n\tfor <dev@dpdk.org>; Mon, 29 Jul 2019 14:16:34 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE2 (envelope-from\n\tmatan@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 29 Jul 2019 15:16:29 +0300",
            "from pegasus07.mtr.labs.mlnx (pegasus07.mtr.labs.mlnx\n\t[10.210.16.112])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x6TCGS4I021429;\n\tMon, 29 Jul 2019 15:16:29 +0300"
        ],
        "From": "Matan Azrad <matan@mellanox.com>",
        "To": "Shahaf Shuler <shahafs@mellanox.com>, Yongseok Koh <yskoh@mellanox.com>, \n\tViacheslav Ovsiienko <viacheslavo@mellanox.com>",
        "Cc": "dev@dpdk.org, Dekel Peled <dekelp@mellanox.com>",
        "Date": "Mon, 29 Jul 2019 11:53:22 +0000",
        "Message-Id": "<1564401209-18752-5-git-send-email-matan@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1564401209-18752-1-git-send-email-matan@mellanox.com>",
        "References": "<1564401209-18752-1-git-send-email-matan@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 04/11] net/mlx5: support mbuf headroom for LRO\n\tpacket",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Patch [1] zeroes the mbuf headroom when the port is configured with LRO\nbecause when working with more than one stride per packet the HW cannot\nguaranty an headroom in the start stride of each packet.\n\nChange the solution to support mbuf headroom by adding an empty buffer\nas the first packet segment, scatter mode must be enabled to support it.\n\n[1] http://patches.dpdk.org/patch/56912/\n\nSigned-off-by: Matan Azrad <matan@mellanox.com>\nAcked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n doc/guides/nics/mlx5.rst     |  3 +--\n drivers/net/mlx5/mlx5_rxq.c  | 24 ++++++++++++++++--------\n drivers/net/mlx5/mlx5_rxtx.c | 22 +++++++++++++++++++++-\n 3 files changed, 38 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst\nindex 92f1b97..cd550f4 100644\n--- a/doc/guides/nics/mlx5.rst\n+++ b/doc/guides/nics/mlx5.rst\n@@ -165,8 +165,7 @@ Limitations\n \n - LRO:\n \n-  - No mbuf headroom space is created for RX packets when LRO is configured.\n-  - ``scatter_fcs`` is disabled when LRO is configured.\n+  - scatter_fcs is disabled when LRO is configured.\n \n Statistics\n ----------\ndiff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c\nindex bd26ee2..d10c5c1 100644\n--- a/drivers/net/mlx5/mlx5_rxq.c\n+++ b/drivers/net/mlx5/mlx5_rxq.c\n@@ -1599,12 +1599,7 @@ struct mlx5_rxq_ctrl *\n \tunsigned int mb_len = rte_pktmbuf_data_room_size(mp);\n \tunsigned int mprq_stride_size;\n \tstruct mlx5_dev_config *config = &priv->config;\n-\t/*\n-\t * LRO packet may consume all the stride memory, hence we cannot\n-\t * guaranty head-room. A new striding RQ feature may be added in CX6 DX\n-\t * to allow head-room and tail-room for the LRO packets.\n-\t */\n-\tunsigned int strd_headroom_en = mlx5_lro_on(dev) ? 0 : 1;\n+\tunsigned int strd_headroom_en;\n \t/*\n \t * Always allocate extra slots, even if eventually\n \t * the vector Rx will not be used.\n@@ -1645,6 +1640,21 @@ struct mlx5_rxq_ctrl *\n \tif (dev->data->dev_conf.intr_conf.rxq)\n \t\ttmpl->irq = 1;\n \t/*\n+\t * LRO packet may consume all the stride memory, hence we cannot\n+\t * guaranty head-room near the packet memory in the stride.\n+\t * In this case scatter is, for sure, enabled and an empty mbuf may be\n+\t * added in the start for the head-room.\n+\t */\n+\tif (mlx5_lro_on(dev) && RTE_PKTMBUF_HEADROOM > 0 &&\n+\t    non_scatter_min_mbuf_size > mb_len) {\n+\t\tstrd_headroom_en = 0;\n+\t\tmprq_stride_size = RTE_MIN(max_rx_pkt_len,\n+\t\t\t\t\t1u << config->mprq.max_stride_size_n);\n+\t} else {\n+\t\tstrd_headroom_en = 1;\n+\t\tmprq_stride_size = non_scatter_min_mbuf_size;\n+\t}\n+\t/*\n \t * This Rx queue can be configured as a Multi-Packet RQ if all of the\n \t * following conditions are met:\n \t *  - MPRQ is enabled.\n@@ -1653,8 +1663,6 @@ struct mlx5_rxq_ctrl *\n \t *    stride.\n \t *  Otherwise, enable Rx scatter if necessary.\n \t */\n-\tmprq_stride_size = max_rx_pkt_len + RTE_PKTMBUF_HEADROOM *\n-\t\t\t\tstrd_headroom_en;\n \tif (mprq_en &&\n \t    desc > (1U << config->mprq.stride_num_n) &&\n \t    mprq_stride_size <= (1U << config->mprq.max_stride_size_n)) {\ndiff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c\nindex a7ec73d..003eefd 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.c\n+++ b/drivers/net/mlx5/mlx5_rxtx.c\n@@ -1639,6 +1639,7 @@ enum mlx5_txcmp_code {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\trte_memcpy(rte_pktmbuf_mtod(pkt, void *), addr, len);\n+\t\t\tDATA_LEN(pkt) = len;\n \t\t} else {\n \t\t\trte_iova_t buf_iova;\n \t\t\tstruct rte_mbuf_ext_shared_info *shinfo;\n@@ -1679,6 +1680,26 @@ enum mlx5_txcmp_code {\n \t\t\t\t++rxq->stats.idropped;\n \t\t\t\tcontinue;\n \t\t\t}\n+\t\t\tDATA_LEN(pkt) = len;\n+\t\t\t/*\n+\t\t\t * LRO packet may consume all the stride memory, in this\n+\t\t\t * case packet head-room space is not guaranteed so must\n+\t\t\t * to add an empty mbuf for the head-room.\n+\t\t\t */\n+\t\t\tif (!rxq->strd_headroom_en) {\n+\t\t\t\tstruct rte_mbuf *headroom_mbuf =\n+\t\t\t\t\t\trte_pktmbuf_alloc(rxq->mp);\n+\n+\t\t\t\tif (unlikely(headroom_mbuf == NULL)) {\n+\t\t\t\t\trte_pktmbuf_free_seg(pkt);\n+\t\t\t\t\t++rxq->stats.rx_nombuf;\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\t\t\t\tPORT(pkt) = rxq->port_id;\n+\t\t\t\tNEXT(headroom_mbuf) = pkt;\n+\t\t\t\tpkt = headroom_mbuf;\n+\t\t\t\tNB_SEGS(pkt) = 2;\n+\t\t\t}\n \t\t}\n \t\trxq_cq_to_mbuf(rxq, pkt, cqe, rss_hash_res);\n \t\tif (lro_num_seg > 1) {\n@@ -1687,7 +1708,6 @@ enum mlx5_txcmp_code {\n \t\t\tpkt->tso_segsz = strd_sz;\n \t\t}\n \t\tPKT_LEN(pkt) = len;\n-\t\tDATA_LEN(pkt) = len;\n \t\tPORT(pkt) = rxq->port_id;\n #ifdef MLX5_PMD_SOFT_COUNTERS\n \t\t/* Increment bytes counter. */\n",
    "prefixes": [
        "04/11"
    ]
}