Show a patch.

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

{
    "id": 42967,
    "url": "http://patches.dpdk.org/api/patches/42967/",
    "web_url": "http://patches.dpdk.org/patch/42967/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<f1d3890e9b9d40ad4cd5cf5c037038395d50940d.1531387413.git.nelio.laranjeiro@6wind.com>",
    "date": "2018-07-12T09:31:06",
    "name": "[v4,20/21] net/mlx5: add flow MPLS item",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0d8ba4a7211d044aafed46d6640b62930fc5a1ed",
    "submitter": {
        "id": 243,
        "url": "http://patches.dpdk.org/api/people/243/",
        "name": "Nélio Laranjeiro",
        "email": "nelio.laranjeiro@6wind.com"
    },
    "delegate": {
        "id": 6624,
        "url": "http://patches.dpdk.org/api/users/6624/",
        "username": "shahafs",
        "first_name": "Shahaf",
        "last_name": "Shuler",
        "email": "shahafs@mellanox.com"
    },
    "mbox": "http://patches.dpdk.org/patch/42967/mbox/",
    "series": [
        {
            "id": 544,
            "url": "http://patches.dpdk.org/api/series/544/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=544",
            "date": "2018-07-12T09:30:46",
            "name": "net/mlx5: flow rework",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/544/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/42967/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/42967/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "In-Reply-To": "<cover.1531387413.git.nelio.laranjeiro@6wind.com>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Mailer": "git-send-email 2.18.0",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 95DC71B8C7;\n\tThu, 12 Jul 2018 11:32:07 +0200 (CEST)",
            "from mail-wr1-f68.google.com (mail-wr1-f68.google.com\n\t[209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 1B7FE1B5CE\n\tfor <dev@dpdk.org>; Thu, 12 Jul 2018 11:31:43 +0200 (CEST)",
            "by mail-wr1-f68.google.com with SMTP id e7-v6so1401563wrs.9\n\tfor <dev@dpdk.org>; Thu, 12 Jul 2018 02:31:43 -0700 (PDT)",
            "from laranjeiro-vm.dev.6wind.com\n\t(host.78.145.23.62.rev.coltfrance.com. [62.23.145.78])\n\tby smtp.gmail.com with ESMTPSA id\n\ts2-v6sm18717603wrn.75.2018.07.12.02.31.41\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 12 Jul 2018 02:31:42 -0700 (PDT)"
        ],
        "References": "<cover.1531293415.git.nelio.laranjeiro@6wind.com>\n\t<cover.1531387413.git.nelio.laranjeiro@6wind.com>",
        "X-Google-Smtp-Source": "AAOMgpflv/gpoUg6A1gwoRQ/RbwRrd2oMvKFFAl7/+ZLJxg/PFrqdUokm5YJJIuNFG+paUjSy01fJg==",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=XkLu9STtfJiBZkEvK8aHvPW9fQZoH4oqfYEml2jAkGk=;\n\tb=otn7+guR9ku/LKr+NQaVHwRJ4FyBq9FiK/HDTmpiOU2ft9AUOCNAXT9c5r4ACVFueg\n\tIElzdkWarqEjOhO2Rb88tnpX3YGNuq1xWDClVt3BI79MHN270lzwSkFcE5OpHGOd3rAA\n\t6Ehqv84bITcQzlZtvYVEW5CWZn4KrMJsN0alpLaRFTxhNMJj6woEh+yR77JsuzOuAEpU\n\tQFfhxenICxKVS4u3Afbm0rURaSEz69uc/Y8v2MN5GF4+u0rSghIl2UpUcgLjJEXqzlPy\n\t7IFslBPFcjr5CwwZUHoCOHalE5Vk8SnJk+rS7kU16WtxSu831noFb+ZhQ4Z4Zjjju2lF\n\tAJYg==",
        "X-BeenThere": "dev@dpdk.org",
        "X-Received": "by 2002:adf:c78e:: with SMTP id\n\tl14-v6mr1125353wrg.230.1531387902661; \n\tThu, 12 Jul 2018 02:31:42 -0700 (PDT)",
        "Message-Id": "<f1d3890e9b9d40ad4cd5cf5c037038395d50940d.1531387413.git.nelio.laranjeiro@6wind.com>",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=XkLu9STtfJiBZkEvK8aHvPW9fQZoH4oqfYEml2jAkGk=;\n\tb=qfI1lHzyn4DX7PoYnUUdMLWmBrv4U4f3qaPrTVFZ47Lr/Hja/qZcYlNUuL0KLmnRV9\n\t6kLgtO1h85MIp9uaijRIknkQtIx7hVqD9ZCXq4xrDzv39OfJd69RUnJiJt8/+qLhmVWR\n\tf3NSeF5gaQWgMW8KhNV/YSfokU0Uf0QPppk4XMEkjXdmE6+wHlPSb6wZGtxWKe95LB1H\n\tuLoVL+J9rS3RTUrBGRhs5PchEsQEiaO8W0ZKFUvDS0G8t1IUISnuFBnsRiWo+fe/e33f\n\tUkmxfEkGE1z3pAAoh5v+zlY/8o7cKT95xemM/sG1tj45xTNn3NUpxMispTX8zzts2pr4\n\tUANA==",
        "Delivered-To": "patchwork@dpdk.org",
        "Precedence": "list",
        "From": "Nelio Laranjeiro <nelio.laranjeiro@6wind.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@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>",
        "To": "dev@dpdk.org,\n\tYongseok Koh <yskoh@mellanox.com>",
        "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>",
        "Date": "Thu, 12 Jul 2018 11:31:06 +0200",
        "X-Gm-Message-State": "AOUpUlE2/Euar12EpqKzB6bbVqhskbvGCC/tMl4MqeG7twd68QmLjdXo\n\tZqdZBKEQWRUfRXvIbSnyrbr8Y2dBDw==",
        "Cc": "Adrien Mazarguil <adrien.mazarguil@6wind.com>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH v4 20/21] net/mlx5: add flow MPLS item"
    },
    "content": "Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>\nAcked-by: Yongseok Koh <yskoh@mellanox.com>\n---\n drivers/net/mlx5/mlx5_flow.c | 102 ++++++++++++++++++++++++++++++++++-\n drivers/net/mlx5/mlx5_rxtx.h |   2 +-\n 2 files changed, 101 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex b05e30204..1d7b72ac1 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -55,6 +55,7 @@ extern const struct eth_dev_ops mlx5_dev_ops_isolate;\n #define MLX5_FLOW_LAYER_VXLAN (1u << 12)\n #define MLX5_FLOW_LAYER_VXLAN_GPE (1u << 13)\n #define MLX5_FLOW_LAYER_GRE (1u << 14)\n+#define MLX5_FLOW_LAYER_MPLS (1u << 15)\n \n /* Outer Masks. */\n #define MLX5_FLOW_LAYER_OUTER_L3 \\\n@@ -68,7 +69,7 @@ extern const struct eth_dev_ops mlx5_dev_ops_isolate;\n /* Tunnel Masks. */\n #define MLX5_FLOW_LAYER_TUNNEL \\\n \t(MLX5_FLOW_LAYER_VXLAN | MLX5_FLOW_LAYER_VXLAN_GPE | \\\n-\t MLX5_FLOW_LAYER_GRE)\n+\t MLX5_FLOW_LAYER_GRE | MLX5_FLOW_LAYER_MPLS)\n \n /* Inner Masks. */\n #define MLX5_FLOW_LAYER_INNER_L3 \\\n@@ -92,6 +93,7 @@ extern const struct eth_dev_ops mlx5_dev_ops_isolate;\n #define MLX5_IP_PROTOCOL_TCP 6\n #define MLX5_IP_PROTOCOL_UDP 17\n #define MLX5_IP_PROTOCOL_GRE 47\n+#define MLX5_IP_PROTOCOL_MPLS 147\n \n /* Priority reserved for default flows. */\n #define MLX5_FLOW_PRIO_RSVD ((uint32_t)-1)\n@@ -109,6 +111,7 @@ enum mlx5_expansion {\n \tMLX5_EXPANSION_VXLAN,\n \tMLX5_EXPANSION_VXLAN_GPE,\n \tMLX5_EXPANSION_GRE,\n+\tMLX5_EXPANSION_MPLS,\n \tMLX5_EXPANSION_ETH,\n \tMLX5_EXPANSION_IPV4,\n \tMLX5_EXPANSION_IPV4_UDP,\n@@ -134,7 +137,8 @@ static const struct rte_flow_expand_node mlx5_support_expansion[] = {\n \t},\n \t[MLX5_EXPANSION_OUTER_ETH] = {\n \t\t.next = RTE_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_OUTER_IPV4,\n-\t\t\t\t\t\t MLX5_EXPANSION_OUTER_IPV6),\n+\t\t\t\t\t\t MLX5_EXPANSION_OUTER_IPV6,\n+\t\t\t\t\t\t MLX5_EXPANSION_MPLS),\n \t\t.type = RTE_FLOW_ITEM_TYPE_ETH,\n \t\t.rss_types = 0,\n \t},\n@@ -189,6 +193,11 @@ static const struct rte_flow_expand_node mlx5_support_expansion[] = {\n \t\t.next = RTE_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4),\n \t\t.type = RTE_FLOW_ITEM_TYPE_GRE,\n \t},\n+\t[MLX5_EXPANSION_MPLS] = {\n+\t\t.next = RTE_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4,\n+\t\t\t\t\t\t MLX5_EXPANSION_IPV6),\n+\t\t.type = RTE_FLOW_ITEM_TYPE_MPLS,\n+\t},\n \t[MLX5_EXPANSION_ETH] = {\n \t\t.next = RTE_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4,\n \t\t\t\t\t\t MLX5_EXPANSION_IPV6),\n@@ -341,6 +350,14 @@ static struct mlx5_flow_tunnel_info tunnels_info[] = {\n \t\t.tunnel = MLX5_FLOW_LAYER_GRE,\n \t\t.ptype = RTE_PTYPE_TUNNEL_GRE,\n \t},\n+\t{\n+\t\t.tunnel = MLX5_FLOW_LAYER_MPLS | MLX5_FLOW_LAYER_OUTER_L4_UDP,\n+\t\t.ptype = RTE_PTYPE_TUNNEL_MPLS_IN_GRE | RTE_PTYPE_L4_UDP,\n+\t},\n+\t{\n+\t\t.tunnel = MLX5_FLOW_LAYER_MPLS,\n+\t\t.ptype = RTE_PTYPE_TUNNEL_MPLS_IN_GRE,\n+\t},\n };\n \n /**\n@@ -1593,6 +1610,84 @@ mlx5_flow_item_gre(const struct rte_flow_item *item,\n \treturn size;\n }\n \n+/**\n+ * Convert the @p item into a Verbs specification after ensuring the NIC\n+ * will understand and process it correctly.\n+ * If the necessary size for the conversion is greater than the @p flow_size,\n+ * nothing is written in @p flow, the validation is still performed.\n+ *\n+ * @param[in] item\n+ *   Item specification.\n+ * @param[in, out] flow\n+ *   Pointer to flow structure.\n+ * @param[in] flow_size\n+ *   Size in bytes of the available space in @p flow, if too small, nothing is\n+ *   written.\n+ * @param[out] error\n+ *   Pointer to error structure.\n+ *\n+ * @return\n+ *   On success the number of bytes consumed/necessary, if the returned value\n+ *   is lesser or equal to @p flow_size, the @p item has fully been converted,\n+ *   otherwise another call with this returned memory size should be done.\n+ *   On error, a negative errno value is returned and rte_errno is set.\n+ */\n+static int\n+mlx5_flow_item_mpls(const struct rte_flow_item *item __rte_unused,\n+\t\t    struct rte_flow *flow __rte_unused,\n+\t\t    const size_t flow_size __rte_unused,\n+\t\t    struct rte_flow_error *error)\n+{\n+#ifdef HAVE_IBV_DEVICE_MPLS_SUPPORT\n+\tconst struct rte_flow_item_mpls *spec = item->spec;\n+\tconst struct rte_flow_item_mpls *mask = item->mask;\n+\tunsigned int size = sizeof(struct ibv_flow_spec_mpls);\n+\tstruct ibv_flow_spec_mpls mpls = {\n+\t\t.type = IBV_FLOW_SPEC_MPLS,\n+\t\t.size = size,\n+\t};\n+\tint ret;\n+\n+\tif (flow->l3_protocol_en && flow->l3_protocol != MLX5_IP_PROTOCOL_MPLS)\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t  item,\n+\t\t\t\t\t  \"protocol filtering not compatible\"\n+\t\t\t\t\t  \" with MPLS layer\");\n+\tif (flow->layers & MLX5_FLOW_LAYER_TUNNEL)\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t  item,\n+\t\t\t\t\t  \"a tunnel is already\"\n+\t\t\t\t\t  \" present\");\n+\tif (!mask)\n+\t\tmask = &rte_flow_item_mpls_mask;\n+\tret = mlx5_flow_item_acceptable\n+\t\t(item, (const uint8_t *)mask,\n+\t\t (const uint8_t *)&rte_flow_item_mpls_mask,\n+\t\t sizeof(struct rte_flow_item_mpls), error);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\tif (spec) {\n+\t\tmemcpy(&mpls.val.label, spec, sizeof(mpls.val.label));\n+\t\tmemcpy(&mpls.mask.label, mask, sizeof(mpls.mask.label));\n+\t\t/* Remove unwanted bits from values.  */\n+\t\tmpls.val.label &= mpls.mask.label;\n+\t}\n+\tif (size <= flow_size) {\n+\t\tmlx5_flow_spec_verbs_add(flow, &mpls, size);\n+\t\tflow->cur_verbs->attr->priority = MLX5_PRIORITY_MAP_L2;\n+\t}\n+\tflow->layers |= MLX5_FLOW_LAYER_MPLS;\n+\treturn size;\n+#endif /* !HAVE_IBV_DEVICE_MPLS_SUPPORT */\n+\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t  RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t  item,\n+\t\t\t\t  \"MPLS is not supported by Verbs, please\"\n+\t\t\t\t  \" update.\");\n+}\n+\n /**\n  * Convert the @p pattern into a Verbs specifications after ensuring the NIC\n  * will understand and process it correctly.\n@@ -1662,6 +1757,9 @@ mlx5_flow_items(struct rte_eth_dev *dev,\n \t\tcase RTE_FLOW_ITEM_TYPE_GRE:\n \t\t\tret = mlx5_flow_item_gre(pattern, flow, remain, error);\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_MPLS:\n+\t\t\tret = mlx5_flow_item_mpls(pattern, flow, remain, error);\n+\t\t\tbreak;\n \t\tdefault:\n \t\t\treturn rte_flow_error_set(error, ENOTSUP,\n \t\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ITEM,\ndiff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h\nindex 53992e8db..a04a84fec 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.h\n+++ b/drivers/net/mlx5/mlx5_rxtx.h\n@@ -35,7 +35,7 @@\n #include \"mlx5_prm.h\"\n \n /* Support tunnel matching. */\n-#define MLX5_FLOW_TUNNEL 3\n+#define MLX5_FLOW_TUNNEL 5\n \n struct mlx5_rxq_stats {\n \tunsigned int idx; /**< Mapping index. */\n",
    "prefixes": [
        "v4",
        "20/21"
    ]
}