get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 56832,
    "url": "https://patches.dpdk.org/api/patches/56832/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1563786795-14027-7-git-send-email-matan@mellanox.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": "<1563786795-14027-7-git-send-email-matan@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1563786795-14027-7-git-send-email-matan@mellanox.com",
    "date": "2019-07-22T09:12:53",
    "name": "[06/28] net/mlx5: check conditions to enable LRO",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "293bebaf969cc892e445dd20ebaaee521707da87",
    "submitter": {
        "id": 796,
        "url": "https://patches.dpdk.org/api/people/796/?format=api",
        "name": "Matan Azrad",
        "email": "matan@mellanox.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/1563786795-14027-7-git-send-email-matan@mellanox.com/mbox/",
    "series": [
        {
            "id": 5639,
            "url": "https://patches.dpdk.org/api/series/5639/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5639",
            "date": "2019-07-22T09:12:48",
            "name": "net/mlx5: support LRO",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/5639/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/56832/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/56832/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 F40EC1BE18;\n\tMon, 22 Jul 2019 11:13:43 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id 474B31BDF1\n\tfor <dev@dpdk.org>; Mon, 22 Jul 2019 11:13:29 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE2 (envelope-from\n\tmatan@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 22 Jul 2019 12:13:23 +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 x6M9DMjV010084;\n\tMon, 22 Jul 2019 12:13:23 +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, 22 Jul 2019 09:12:53 +0000",
        "Message-Id": "<1563786795-14027-7-git-send-email-matan@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1563786795-14027-1-git-send-email-matan@mellanox.com>",
        "References": "<1563786795-14027-1-git-send-email-matan@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 06/28] net/mlx5: check conditions to enable LRO",
        "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": "From: Dekel Peled <dekelp@mellanox.com>\n\nUse DevX API to read device LRO capabilities.\nCheck if LRO is supported and can be enabled.\nCheck if MPRQ is supported and can be used.\nEnable MPRQ for LRO use if not enabled by user.\nAdded note for mlx5_mprq_enabled(), to emphasize that LRO\nenables MPRQ.\nDisable CQE compression and CRC stripping if LRO is enabled.\n\nSigned-off-by: Dekel Peled <dekelp@mellanox.com>\nAcked-by: Matan Azrad <matan@mellanox.com>\n---\n drivers/net/mlx5/mlx5.c        | 49 +++++++++++++++++++++++++++---------------\n drivers/net/mlx5/mlx5_ethdev.c | 12 +++++++++++\n drivers/net/mlx5/mlx5_rxq.c    | 14 +++++++++++-\n 3 files changed, 57 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 792324f..8d0ebeb 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -1683,6 +1683,38 @@ struct mlx5_dev_spawn_data {\n \t} else if (config.cqe_pad) {\n \t\tDRV_LOG(INFO, \"Rx CQE padding is enabled\");\n \t}\n+\tif (config.devx) {\n+\t\tpriv->counter_fallback = 0;\n+\t\terr = mlx5_devx_cmd_query_hca_attr(sh->ctx, &config.hca_attr);\n+\t\tif (err) {\n+\t\t\terr = -err;\n+\t\t\tgoto error;\n+\t\t}\n+\t\tif (!config.hca_attr.flow_counters_dump)\n+\t\t\tpriv->counter_fallback = 1;\n+#ifndef HAVE_IBV_DEVX_ASYNC\n+\t\tpriv->counter_fallback = 1;\n+#endif\n+\t\tif (priv->counter_fallback)\n+\t\t\tDRV_LOG(INFO, \"Use fall-back DV counter management\\n\");\n+\t\t/* Check for LRO support. */\n+\t\tif (config.dest_tir && mprq && config.hca_attr.lro_cap) {\n+\t\t\t/* TBD check tunnel lro caps. */\n+\t\t\tconfig.lro.supported = config.hca_attr.lro_cap;\n+\t\t\tDRV_LOG(DEBUG, \"Device supports LRO\");\n+\t\t\t/*\n+\t\t\t * If LRO timeout is not configured by application,\n+\t\t\t * use the minimal supported value.\n+\t\t\t */\n+\t\t\tif (!config.lro.timeout)\n+\t\t\t\tconfig.lro.timeout =\n+\t\t\t\tconfig.hca_attr.lro_timer_supported_periods[0];\n+\t\t\tDRV_LOG(DEBUG, \"LRO session timeout set to %d usec\",\n+\t\t\t\tconfig.lro.timeout);\n+\t\t\tconfig.mprq.enabled = 1;\n+\t\t\tDRV_LOG(DEBUG, \"Enable MPRQ for LRO use\");\n+\t\t}\n+\t}\n \tif (config.mprq.enabled && mprq) {\n \t\tif (config.mprq.stride_num_n > mprq_max_stride_num_n ||\n \t\t    config.mprq.stride_num_n < mprq_min_stride_num_n) {\n@@ -1783,23 +1815,6 @@ struct mlx5_dev_spawn_data {\n \t * Verbs context returned by ibv_open_device().\n \t */\n \tmlx5_link_update(eth_dev, 0);\n-#ifdef HAVE_IBV_DEVX_OBJ\n-\tif (config.devx) {\n-\t\tpriv->counter_fallback = 0;\n-\t\terr = mlx5_devx_cmd_query_hca_attr(sh->ctx, &config.hca_attr);\n-\t\tif (err) {\n-\t\t\terr = -err;\n-\t\t\tgoto error;\n-\t\t}\n-\t\tif (!config.hca_attr.flow_counters_dump)\n-\t\t\tpriv->counter_fallback = 1;\n-#ifndef HAVE_IBV_DEVX_ASYNC\n-\t\tpriv->counter_fallback = 1;\n-#endif\n-\t\tif (priv->counter_fallback)\n-\t\t\tDRV_LOG(INFO, \"Use fall-back DV counter management\\n\");\n-\t}\n-#endif\n #ifdef HAVE_MLX5DV_DR_ESWITCH\n \tif (!(config.hca_attr.eswitch_manager && config.dv_flow_en &&\n \t      (switch_info->representor || switch_info->master)))\ndiff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c\nindex 1125e16..72416db 100644\n--- a/drivers/net/mlx5/mlx5_ethdev.c\n+++ b/drivers/net/mlx5/mlx5_ethdev.c\n@@ -482,6 +482,7 @@ struct ethtool_link_settings {\n \tconst uint8_t use_app_rss_key =\n \t\t!!dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key;\n \tint ret = 0;\n+\tunsigned int lro_on = mlx5_lro_on(dev);\n \n \tif (use_app_rss_key &&\n \t    (dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len !=\n@@ -525,6 +526,12 @@ struct ethtool_link_settings {\n \t\t\tdev->data->port_id, priv->rxqs_n, rxqs_n);\n \t\tpriv->rxqs_n = rxqs_n;\n \t\t/*\n+\t\t * WHen using LRO, MPRQ is implicitly enabled.\n+\t\t * Adjust threshold value to ensure MPRQ can be enabled.\n+\t\t */\n+\t\tif (lro_on && priv->config.mprq.min_rxqs_num > priv->rxqs_n)\n+\t\t\tpriv->config.mprq.min_rxqs_num = priv->rxqs_n;\n+\t\t/*\n \t\t * If the requested number of RX queues is not a power of two,\n \t\t * use the maximum indirection table size for better balancing.\n \t\t * The result is always rounded to the next power of two.\n@@ -546,6 +553,11 @@ struct ethtool_link_settings {\n \t\t\t\tj = 0;\n \t\t}\n \t}\n+\tif (lro_on && priv->config.cqe_comp) {\n+\t\t/* CQE compressing is not supported for LRO CQEs. */\n+\t\tDRV_LOG(WARNING, \"Rx CQE compression isn't supported with LRO\");\n+\t\tpriv->config.cqe_comp = 0;\n+\t}\n \tret = mlx5_proc_priv_init(dev);\n \tif (ret)\n \t\treturn ret;\ndiff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c\nindex e68de50..8567ee5 100644\n--- a/drivers/net/mlx5/mlx5_rxq.c\n+++ b/drivers/net/mlx5/mlx5_rxq.c\n@@ -93,6 +93,7 @@\n \n /**\n  * Check whether Multi-Packet RQ is enabled for the device.\n+ * MPRQ can be enabled explicitly, or implicitly by enabling LRO.\n  *\n  * @param dev\n  *   Pointer to Ethernet device.\n@@ -1431,7 +1432,18 @@ struct mlx5_rxq_ctrl *\n \ttmpl->rxq.crc_present = 0;\n \tif (offloads & DEV_RX_OFFLOAD_KEEP_CRC) {\n \t\tif (config->hw_fcs_strip) {\n-\t\t\ttmpl->rxq.crc_present = 1;\n+\t\t\t/*\n+\t\t\t * RQs used for LRO-enabled TIRs should not be\n+\t\t\t * configured to scatter the FCS.\n+\t\t\t */\n+\t\t\tif (mlx5_lro_on(dev))\n+\t\t\t\tDRV_LOG(WARNING,\n+\t\t\t\t\t\"port %u CRC stripping has been \"\n+\t\t\t\t\t\"disabled but will still be performed \"\n+\t\t\t\t\t\"by hardware, because LRO is enabled\",\n+\t\t\t\t\tdev->data->port_id);\n+\t\t\telse\n+\t\t\t\ttmpl->rxq.crc_present = 1;\n \t\t} else {\n \t\t\tDRV_LOG(WARNING,\n \t\t\t\t\"port %u CRC stripping has been disabled but will\"\n",
    "prefixes": [
        "06/28"
    ]
}