get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 63992,
    "url": "http://patches.dpdk.org/api/patches/63992/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/a78d01d9e89d9501d2669413beb9710c33146f0c.1576663258.git.dekelp@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": "<a78d01d9e89d9501d2669413beb9710c33146f0c.1576663258.git.dekelp@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/a78d01d9e89d9501d2669413beb9710c33146f0c.1576663258.git.dekelp@mellanox.com",
    "date": "2019-12-18T10:05:47",
    "name": "[2/2] net/mlx5: support RSS on SRC or DST fields only",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "b76e4a62c4eca9116fe16029e020d55fb7205aea",
    "submitter": {
        "id": 1082,
        "url": "http://patches.dpdk.org/api/people/1082/?format=api",
        "name": "Dekel Peled",
        "email": "dekelp@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/a78d01d9e89d9501d2669413beb9710c33146f0c.1576663258.git.dekelp@mellanox.com/mbox/",
    "series": [
        {
            "id": 7887,
            "url": "http://patches.dpdk.org/api/series/7887/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7887",
            "date": "2019-12-18T10:05:47",
            "name": "net/mlx5: update RSS action handling",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/7887/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/63992/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/63992/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 27E70A050F;\n\tWed, 18 Dec 2019 11:06:11 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BA82D2C17;\n\tWed, 18 Dec 2019 11:06:09 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id EBA20330\n for <dev@dpdk.org>; Wed, 18 Dec 2019 11:06:07 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n dekelp@mellanox.com)\n with ESMTPS (AES256-SHA encrypted); 18 Dec 2019 12:06:06 +0200",
            "from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx\n [10.128.130.87])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id xBIA64Xi010229;\n Wed, 18 Dec 2019 12:06:06 +0200"
        ],
        "From": "Dekel Peled <dekelp@mellanox.com>",
        "To": "matan@mellanox.com, viacheslavo@mellanox.com, shahafs@mellanox.com",
        "Cc": "orika@mellanox.com, dev@dpdk.org",
        "Date": "Wed, 18 Dec 2019 12:05:47 +0200",
        "Message-Id": "\n <a78d01d9e89d9501d2669413beb9710c33146f0c.1576663258.git.dekelp@mellanox.com>",
        "X-Mailer": "git-send-email 1.7.1",
        "In-Reply-To": "<cover.1576663258.git.dekelp@mellanox.com>",
        "References": "<cover.1576663258.git.dekelp@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 2/2] net/mlx5: support RSS on SRC or DST fields\n\tonly",
        "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": "This patch implements the feature described in RFC [1], adding\nsupport of RSS action on L3 and/or L4 source or destination only.\n\n[1] http://mails.dpdk.org/archives/dev/2019-December/152796.html\n\nSigned-off-by: Dekel Peled <dekelp@mellanox.com>\nAcked-by: Matan Azrad <matan@mellanox.com>\n---\n doc/guides/nics/mlx5.rst               |  2 +\n doc/guides/rel_notes/release_20_02.rst |  6 +++\n drivers/net/mlx5/mlx5_defs.h           |  7 ++-\n drivers/net/mlx5/mlx5_flow.c           | 12 +++++\n drivers/net/mlx5/mlx5_flow_dv.c        | 91 ++++++++++++++++++++++++++--------\n 5 files changed, 97 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst\nindex 18573cf..92228d3 100644\n--- a/doc/guides/nics/mlx5.rst\n+++ b/doc/guides/nics/mlx5.rst\n@@ -64,6 +64,8 @@ Features\n - Multiple TX and RX queues.\n - Support for scattered TX and RX frames.\n - IPv4, IPv6, TCPv4, TCPv6, UDPv4 and UDPv6 RSS on any number of queues.\n+- RSS using different combinations of fields: L3 only, L4 only or both,\n+  and source only, destination only or both.\n - Several RSS hash keys, one for each flow type.\n - Default RSS operation with no hash key specification.\n - Configurable RETA table.\ndiff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst\nindex 0eaa45a..8cd3470 100644\n--- a/doc/guides/rel_notes/release_20_02.rst\n+++ b/doc/guides/rel_notes/release_20_02.rst\n@@ -56,6 +56,12 @@ New Features\n      Also, make sure to start the actual text at the margin.\n      =========================================================\n \n+* **Updated Mellanox mlx5 driver.**\n+\n+  Updated Mellanox mlx5 driver with new features and improvements, including:\n+\n+  * Added support for RSS using L3/L4 source/destination only.\n+\n \n Removed Items\n -------------\ndiff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h\nindex 042e1f3..dc9b965 100644\n--- a/drivers/net/mlx5/mlx5_defs.h\n+++ b/drivers/net/mlx5/mlx5_defs.h\n@@ -104,8 +104,13 @@\n /* Number of packets vectorized Rx can simultaneously process in a loop. */\n #define MLX5_VPMD_DESCS_PER_LOOP      4\n \n+/* Mask of RSS on source only or destination only. */\n+#define MLX5_RSS_SRC_DST_ONLY (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY | \\\n+\t\t\t       ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY)\n+\n /* Supported RSS */\n-#define MLX5_RSS_HF_MASK (~(ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP))\n+#define MLX5_RSS_HF_MASK (~(ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP | \\\n+\t\t\t    MLX5_RSS_SRC_DST_ONLY))\n \n /* Timeout in seconds to get a valid link status. */\n #define MLX5_LINK_STATUS_TIMEOUT 10\ndiff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex 0087163..cb9d265 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -1150,6 +1150,18 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \t\t\t\t\t  &rss->types,\n \t\t\t\t\t  \"some RSS protocols are not\"\n \t\t\t\t\t  \" supported\");\n+\tif ((rss->types & (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY)) &&\n+\t    !(rss->types & ETH_RSS_IP))\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL,\n+\t\t\t\t\t  \"L3 partial RSS requested but L3 RSS\"\n+\t\t\t\t\t  \" type not specified\");\n+\tif ((rss->types & (ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY)) &&\n+\t    !(rss->types & (ETH_RSS_UDP | ETH_RSS_TCP)))\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL,\n+\t\t\t\t\t  \"L4 partial RSS requested but L4 RSS\"\n+\t\t\t\t\t  \" type not specified\");\n \tif (!priv->rxqs_n)\n \t\treturn rte_flow_error_set(error, EINVAL,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION_CONF,\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 73aaea4..12cbf17 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -6577,6 +6577,75 @@ struct field_modify_info modify_tcp[] = {\n }\n \n /**\n+ * Set the hash fields according to the @p flow information.\n+ *\n+ * @param[in] dev_flow\n+ *   Pointer to the mlx5_flow.\n+ */\n+static void\n+flow_dv_hashfields_set(struct mlx5_flow *dev_flow)\n+{\n+\tstruct rte_flow *flow = dev_flow->flow;\n+\tuint64_t items = dev_flow->layers;\n+\tint rss_inner = 0;\n+\tuint64_t rss_types = rte_eth_rss_hf_refine(flow->rss.types);\n+\n+\tdev_flow->hash_fields = 0;\n+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT\n+\tif (flow->rss.level >= 2) {\n+\t\tdev_flow->hash_fields |= IBV_RX_HASH_INNER;\n+\t\trss_inner = 1;\n+\t}\n+#endif\n+\tif ((rss_inner && (items & MLX5_FLOW_LAYER_INNER_L3_IPV4)) ||\n+\t    (!rss_inner && (items & MLX5_FLOW_LAYER_OUTER_L3_IPV4))) {\n+\t\tif (rss_types & MLX5_IPV4_LAYER_TYPES) {\n+\t\t\tif (rss_types & ETH_RSS_L3_SRC_ONLY)\n+\t\t\t\tdev_flow->hash_fields |= IBV_RX_HASH_SRC_IPV4;\n+\t\t\telse if (rss_types & ETH_RSS_L3_DST_ONLY)\n+\t\t\t\tdev_flow->hash_fields |= IBV_RX_HASH_DST_IPV4;\n+\t\t\telse\n+\t\t\t\tdev_flow->hash_fields |= MLX5_IPV4_IBV_RX_HASH;\n+\t\t}\n+\t} else if ((rss_inner && (items & MLX5_FLOW_LAYER_INNER_L3_IPV6)) ||\n+\t\t   (!rss_inner && (items & MLX5_FLOW_LAYER_OUTER_L3_IPV6))) {\n+\t\tif (rss_types & MLX5_IPV6_LAYER_TYPES) {\n+\t\t\tif (rss_types & ETH_RSS_L3_SRC_ONLY)\n+\t\t\t\tdev_flow->hash_fields |= IBV_RX_HASH_SRC_IPV6;\n+\t\t\telse if (rss_types & ETH_RSS_L3_DST_ONLY)\n+\t\t\t\tdev_flow->hash_fields |= IBV_RX_HASH_DST_IPV6;\n+\t\t\telse\n+\t\t\t\tdev_flow->hash_fields |= MLX5_IPV6_IBV_RX_HASH;\n+\t\t}\n+\t}\n+\tif ((rss_inner && (items & MLX5_FLOW_LAYER_INNER_L4_UDP)) ||\n+\t    (!rss_inner && (items & MLX5_FLOW_LAYER_OUTER_L4_UDP))) {\n+\t\tif (rss_types & ETH_RSS_UDP) {\n+\t\t\tif (rss_types & ETH_RSS_L4_SRC_ONLY)\n+\t\t\t\tdev_flow->hash_fields |=\n+\t\t\t\t\t\tIBV_RX_HASH_SRC_PORT_UDP;\n+\t\t\telse if (rss_types & ETH_RSS_L4_DST_ONLY)\n+\t\t\t\tdev_flow->hash_fields |=\n+\t\t\t\t\t\tIBV_RX_HASH_DST_PORT_UDP;\n+\t\t\telse\n+\t\t\t\tdev_flow->hash_fields |= MLX5_UDP_IBV_RX_HASH;\n+\t\t}\n+\t} else if ((rss_inner && (items & MLX5_FLOW_LAYER_INNER_L4_TCP)) ||\n+\t\t   (!rss_inner && (items & MLX5_FLOW_LAYER_OUTER_L4_TCP))) {\n+\t\tif (rss_types & ETH_RSS_TCP) {\n+\t\t\tif (rss_types & ETH_RSS_L4_SRC_ONLY)\n+\t\t\t\tdev_flow->hash_fields |=\n+\t\t\t\t\t\tIBV_RX_HASH_SRC_PORT_TCP;\n+\t\t\telse if (rss_types & ETH_RSS_L4_DST_ONLY)\n+\t\t\t\tdev_flow->hash_fields |=\n+\t\t\t\t\t\tIBV_RX_HASH_DST_PORT_TCP;\n+\t\t\telse\n+\t\t\t\tdev_flow->hash_fields |= MLX5_TCP_IBV_RX_HASH;\n+\t\t}\n+\t}\n+}\n+\n+/**\n  * Fill the flow with DV spec, lock free\n  * (mutex should be acquired by caller).\n  *\n@@ -7086,11 +7155,6 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t\t    items, tunnel,\n \t\t\t\t\t\t    dev_flow->group);\n \t\t\tmatcher.priority = MLX5_PRIORITY_MAP_L3;\n-\t\t\tdev_flow->hash_fields |=\n-\t\t\t\tmlx5_flow_hashfields_adjust\n-\t\t\t\t\t(dev_flow, tunnel,\n-\t\t\t\t\t MLX5_IPV4_LAYER_TYPES,\n-\t\t\t\t\t MLX5_IPV4_IBV_RX_HASH);\n \t\t\tlast_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV4 :\n \t\t\t\t\t     MLX5_FLOW_LAYER_OUTER_L3_IPV4;\n \t\t\tif (items->mask != NULL &&\n@@ -7114,11 +7178,6 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t\t    items, tunnel,\n \t\t\t\t\t\t    dev_flow->group);\n \t\t\tmatcher.priority = MLX5_PRIORITY_MAP_L3;\n-\t\t\tdev_flow->hash_fields |=\n-\t\t\t\tmlx5_flow_hashfields_adjust\n-\t\t\t\t\t(dev_flow, tunnel,\n-\t\t\t\t\t MLX5_IPV6_LAYER_TYPES,\n-\t\t\t\t\t MLX5_IPV6_IBV_RX_HASH);\n \t\t\tlast_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV6 :\n \t\t\t\t\t     MLX5_FLOW_LAYER_OUTER_L3_IPV6;\n \t\t\tif (items->mask != NULL &&\n@@ -7139,11 +7198,6 @@ struct field_modify_info modify_tcp[] = {\n \t\t\tflow_dv_translate_item_tcp(match_mask, match_value,\n \t\t\t\t\t\t   items, tunnel);\n \t\t\tmatcher.priority = MLX5_PRIORITY_MAP_L4;\n-\t\t\tdev_flow->hash_fields |=\n-\t\t\t\tmlx5_flow_hashfields_adjust\n-\t\t\t\t\t(dev_flow, tunnel, ETH_RSS_TCP,\n-\t\t\t\t\t IBV_RX_HASH_SRC_PORT_TCP |\n-\t\t\t\t\t IBV_RX_HASH_DST_PORT_TCP);\n \t\t\tlast_item = tunnel ? MLX5_FLOW_LAYER_INNER_L4_TCP :\n \t\t\t\t\t     MLX5_FLOW_LAYER_OUTER_L4_TCP;\n \t\t\tbreak;\n@@ -7151,11 +7205,6 @@ struct field_modify_info modify_tcp[] = {\n \t\t\tflow_dv_translate_item_udp(match_mask, match_value,\n \t\t\t\t\t\t   items, tunnel);\n \t\t\tmatcher.priority = MLX5_PRIORITY_MAP_L4;\n-\t\t\tdev_flow->hash_fields |=\n-\t\t\t\tmlx5_flow_hashfields_adjust\n-\t\t\t\t\t(dev_flow, tunnel, ETH_RSS_UDP,\n-\t\t\t\t\t IBV_RX_HASH_SRC_PORT_UDP |\n-\t\t\t\t\t IBV_RX_HASH_DST_PORT_UDP);\n \t\t\tlast_item = tunnel ? MLX5_FLOW_LAYER_INNER_L4_UDP :\n \t\t\t\t\t     MLX5_FLOW_LAYER_OUTER_L4_UDP;\n \t\t\tbreak;\n@@ -7251,6 +7300,8 @@ struct field_modify_info modify_tcp[] = {\n \tassert(!flow_dv_check_valid_spec(matcher.mask.buf,\n \t\t\t\t\t dev_flow->dv.value.buf));\n \tdev_flow->layers = item_flags;\n+\tif (action_flags & MLX5_FLOW_ACTION_RSS)\n+\t\tflow_dv_hashfields_set(dev_flow);\n \t/* Register matcher. */\n \tmatcher.crc = rte_raw_cksum((const void *)matcher.mask.buf,\n \t\t\t\t    matcher.mask.size);\n",
    "prefixes": [
        "2/2"
    ]
}