Show a patch.

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

{
    "id": 42955,
    "url": "http://patches.dpdk.org/api/patches/42955/",
    "web_url": "http://patches.dpdk.org/patch/42955/",
    "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": "<f4696c1d00488c814533922b82c6b4a7ed2a919f.1531387413.git.nelio.laranjeiro@6wind.com>",
    "date": "2018-07-12T09:30:54",
    "name": "[v4,08/21] net/mlx5: add flow IPv4 item",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "8a472e7cbf65594ca09a0fdea926ea9c54771f66",
    "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/42955/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/42955/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/42955/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 BB3471B5E0;\n\tThu, 12 Jul 2018 11:31:45 +0200 (CEST)",
            "from mail-wm0-f68.google.com (mail-wm0-f68.google.com\n\t[74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 477C91B569\n\tfor <dev@dpdk.org>; Thu, 12 Jul 2018 11:31:32 +0200 (CEST)",
            "by mail-wm0-f68.google.com with SMTP id v128-v6so4942245wme.5\n\tfor <dev@dpdk.org>; Thu, 12 Jul 2018 02:31:32 -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.30\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 12 Jul 2018 02:31:31 -0700 (PDT)"
        ],
        "References": "<cover.1531293415.git.nelio.laranjeiro@6wind.com>\n\t<cover.1531387413.git.nelio.laranjeiro@6wind.com>",
        "X-Google-Smtp-Source": "AAOMgpfQyKU3IPQRgfW0QfdSoWtQ5fa7MP2tZLoaNdZhjfk/pllodNFhlkfB40ZK/vXWwc+OzdL2nw==",
        "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=cKaXDoHr9FbGYEvyIH1bvNtIzTHW/cUuZCkYUi2cv1M=;\n\tb=tWF1PkpTcNdbu5cFaFhetkbCX86zYC9Xp8Im3UHR8L/kBBDHu9H+NZuExKpRZN4OVO\n\tKHQsUwofpfl6HIkTfGM5uCU0tjFwduxJlQVA9cocKPQpIsCIn2IVpp68/xmkh8zxdFrs\n\tCN124oZiYtDCxFLI6sX+vuHg2YV90RB3LJOY8AsAKmWNEzPBjVvYyFhylLCEVF0DwNAp\n\tTfY53SvFu1aAUWG12giIKATVaZMWcIcJFApyGV6A+z/tSq7l2fgoUHXHdb4hhc87tnMC\n\tZ2ap04YEaroWQMKAnUOSPwq0yvzVk4sVmeTz6EsHmjb7X2Xrb/Uvth/dKHzzHjT5ixHT\n\t7ZOQ==",
        "X-BeenThere": "dev@dpdk.org",
        "X-Received": "by 2002:a1c:b6d6:: with SMTP id\n\tg205-v6mr925293wmf.17.1531387891707; \n\tThu, 12 Jul 2018 02:31:31 -0700 (PDT)",
        "Message-Id": "<f4696c1d00488c814533922b82c6b4a7ed2a919f.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=cKaXDoHr9FbGYEvyIH1bvNtIzTHW/cUuZCkYUi2cv1M=;\n\tb=Gs/9yvHWxUJPfpGrSGG/67seH7a4QX84K3d3iSJsqunVzmPIsLR8gQoPNWfXzG7qNE\n\tgrbeodf4p3hd7PUXHkakzCXM94DOcrgM9im8hVW5eTrR3/B/cTEXByIqWyOV68/W0KwY\n\tT0UZobPGqwC9iBx50+eWFxiC1Y8Hape9YpOJRwJgowknLKVOq2eacuUOPOdB2GRgfD2a\n\to1PAO5RTMf3LQoXjY68W8Mt7Feps85GPcbj7tRWvFuBCBdpanKx9DAVDZeGPPVnlMywo\n\tRr4PQVcupn0vpq/Rx5svZavJVLgSZdUQ0ahOBmU/6RV/2Qq7EWy/3szI3/XlhpvMsvh5\n\tt1Ig==",
        "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:30:54 +0200",
        "X-Gm-Message-State": "AOUpUlEK1Z4i3+wA4pe0Xd+9rMwVS5PBgXfFtpAJNgELzZmvdv3TZffL\n\tUM9vkUc8HDmWzcZ4hlekC43wbRouLA==",
        "Cc": "Adrien Mazarguil <adrien.mazarguil@6wind.com>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH v4 08/21] net/mlx5: add flow IPv4 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 | 90 ++++++++++++++++++++++++++++++++++++\n 1 file changed, 90 insertions(+)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex 659979283..c05b8498d 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -506,6 +506,93 @@ mlx5_flow_item_vlan(const struct rte_flow_item *item, struct rte_flow *flow,\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_ipv4(const struct rte_flow_item *item, struct rte_flow *flow,\n+\t\t    const size_t flow_size, struct rte_flow_error *error)\n+{\n+\tconst struct rte_flow_item_ipv4 *spec = item->spec;\n+\tconst struct rte_flow_item_ipv4 *mask = item->mask;\n+\tconst struct rte_flow_item_ipv4 nic_mask = {\n+\t\t.hdr = {\n+\t\t\t.src_addr = RTE_BE32(0xffffffff),\n+\t\t\t.dst_addr = RTE_BE32(0xffffffff),\n+\t\t\t.type_of_service = 0xff,\n+\t\t\t.next_proto_id = 0xff,\n+\t\t},\n+\t};\n+\tunsigned int size = sizeof(struct ibv_flow_spec_ipv4_ext);\n+\tstruct ibv_flow_spec_ipv4_ext ipv4 = {\n+\t\t.type = IBV_FLOW_SPEC_IPV4_EXT,\n+\t\t.size = size,\n+\t};\n+\tint ret;\n+\n+\tif (flow->layers & MLX5_FLOW_LAYER_OUTER_L3)\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  \"multiple L3 layers not supported\");\n+\telse if (flow->layers & MLX5_FLOW_LAYER_OUTER_L4)\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  \"L3 cannot follow an L4 layer.\");\n+\tif (!mask)\n+\t\tmask = &rte_flow_item_ipv4_mask;\n+\tret = mlx5_flow_item_acceptable\n+\t\t(item, (const uint8_t *)mask,\n+\t\t (const uint8_t *)&nic_mask,\n+\t\t sizeof(struct rte_flow_item_ipv4), error);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\tflow->layers |= MLX5_FLOW_LAYER_OUTER_L3_IPV4;\n+\tif (size > flow_size)\n+\t\treturn size;\n+\tif (spec) {\n+\t\tipv4.val = (struct ibv_flow_ipv4_ext_filter){\n+\t\t\t.src_ip = spec->hdr.src_addr,\n+\t\t\t.dst_ip = spec->hdr.dst_addr,\n+\t\t\t.proto = spec->hdr.next_proto_id,\n+\t\t\t.tos = spec->hdr.type_of_service,\n+\t\t};\n+\t\tipv4.mask = (struct ibv_flow_ipv4_ext_filter){\n+\t\t\t.src_ip = mask->hdr.src_addr,\n+\t\t\t.dst_ip = mask->hdr.dst_addr,\n+\t\t\t.proto = mask->hdr.next_proto_id,\n+\t\t\t.tos = mask->hdr.type_of_service,\n+\t\t};\n+\t\t/* Remove unwanted bits from values. */\n+\t\tipv4.val.src_ip &= ipv4.mask.src_ip;\n+\t\tipv4.val.dst_ip &= ipv4.mask.dst_ip;\n+\t\tipv4.val.proto &= ipv4.mask.proto;\n+\t\tipv4.val.tos &= ipv4.mask.tos;\n+\t}\n+\tmlx5_flow_spec_verbs_add(flow, &ipv4, size);\n+\treturn size;\n+}\n+\n /**\n  * Convert the @p pattern into a Verbs specifications after ensuring the NIC\n  * will understand and process it correctly.\n@@ -551,6 +638,9 @@ mlx5_flow_items(const struct rte_flow_item pattern[],\n \t\tcase RTE_FLOW_ITEM_TYPE_VLAN:\n \t\t\tret = mlx5_flow_item_vlan(pattern, flow, remain, error);\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_IPV4:\n+\t\t\tret = mlx5_flow_item_ipv4(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,\n",
    "prefixes": [
        "v4",
        "08/21"
    ]
}