get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 42954,
    "url": "http://patches.dpdk.org/api/patches/42954/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/2cc2794bf1301975f3af6691ffc1c888355ecfcc.1531387413.git.nelio.laranjeiro@6wind.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": "<2cc2794bf1301975f3af6691ffc1c888355ecfcc.1531387413.git.nelio.laranjeiro@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/2cc2794bf1301975f3af6691ffc1c888355ecfcc.1531387413.git.nelio.laranjeiro@6wind.com",
    "date": "2018-07-12T09:30:53",
    "name": "[v4,07/21] net/mlx5: add flow VLAN item",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "294ff50016cc5f0b4de756f103edd0c9febc4fd3",
    "submitter": {
        "id": 243,
        "url": "http://patches.dpdk.org/api/people/243/?format=api",
        "name": "Nélio Laranjeiro",
        "email": "nelio.laranjeiro@6wind.com"
    },
    "delegate": {
        "id": 6624,
        "url": "http://patches.dpdk.org/api/users/6624/?format=api",
        "username": "shahafs",
        "first_name": "Shahaf",
        "last_name": "Shuler",
        "email": "shahafs@mellanox.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/2cc2794bf1301975f3af6691ffc1c888355ecfcc.1531387413.git.nelio.laranjeiro@6wind.com/mbox/",
    "series": [
        {
            "id": 544,
            "url": "http://patches.dpdk.org/api/series/544/?format=api",
            "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/42954/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/42954/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 A52061B5DB;\n\tThu, 12 Jul 2018 11:31:43 +0200 (CEST)",
            "from mail-wr1-f66.google.com (mail-wr1-f66.google.com\n\t[209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 57BA31B54B\n\tfor <dev@dpdk.org>; Thu, 12 Jul 2018 11:31:31 +0200 (CEST)",
            "by mail-wr1-f66.google.com with SMTP id c4-v6so8291190wrs.12\n\tfor <dev@dpdk.org>; Thu, 12 Jul 2018 02:31:31 -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:30 -0700 (PDT)"
        ],
        "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=4/MwwaAcjueWvkzwEy1f8cYFY2ubKDzmrqgq64IhCck=;\n\tb=GAhngPESUPaUPGD5LVwYEGj2KTIAaiLm0ffdlXGhgonoUqZ/vOX+RyTrlp+CFt3sSM\n\tv93xDNkJdcQNyIDlGIbqj0QRIjI2tFmz7K176Vsr7akmnlK1EBzl8dRzoXhL8O7UmGFw\n\tTgGOUaX57Kq/PSME7UAKPv5+9nOe7lz/+uD8hIH2fyJ9mCDv3S8/vaYKOtvefAHu4Xy7\n\tWS2q1djhIpVHsIqYWpe74tl5WC43qc6jDdaDleaPPtaangOb2fQb+nmlW+/7/YdIZf9K\n\tUS/nJ9mzkA3DbF9PuYTqzKS3bYXTQIVa1gXAI04CNA5THwEy0OPUjQVLG3+dC0tQfV4g\n\ts3Sw==",
        "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=4/MwwaAcjueWvkzwEy1f8cYFY2ubKDzmrqgq64IhCck=;\n\tb=WBgQR2UYwdq3COFS/rfBJlqjR5mnhjG3rYsNTFroGKhYzK6ohdZFZHvT+qkS3H3NSE\n\tG4dWfTn6cl7GSIRCOMZ06ZSA4WMs9ISYGmtcKhILSLbmG59vzepBIexziFv7JHQrRhi3\n\ty8f8hEpvnkQHewNBPIbS+HtGog8jEfFKnwVCfUbI/E9OV9eaTYVqKXJKdMRJo5nCj3HD\n\tNlvIzKEFTQi/j3Z3DlSZ3uVvT6SGnL5xozzNf+hIQMdGLKLx1Z2YIztL2PxL2L33YALW\n\tk1OFFqBI+RpxHRcn9VNrheh40kOUlrlJ1p5gdoGob38jEQ/FyunusCL32qot5TTY53kF\n\t+TPA==",
        "X-Gm-Message-State": "AOUpUlHG6/kUOR349HoRMvG27vlo2KSTiBSw6pJF4ZWv6wqGuJKR1D/m\n\t8m9rrlqvIIzNKEYKnci90FXfdywU1A==",
        "X-Google-Smtp-Source": "AAOMgpcU9VgxGzr+ZSHJqo7E4/hotFt4SU72KscyIg3dsdhP+7D4PZGC/Kttb/gOlC0c43c0eod+zA==",
        "X-Received": "by 2002:a5d:480d:: with SMTP id\n\tl13-v6mr1224354wrq.234.1531387890865; \n\tThu, 12 Jul 2018 02:31:30 -0700 (PDT)",
        "From": "Nelio Laranjeiro <nelio.laranjeiro@6wind.com>",
        "To": "dev@dpdk.org,\n\tYongseok Koh <yskoh@mellanox.com>",
        "Cc": "Adrien Mazarguil <adrien.mazarguil@6wind.com>",
        "Date": "Thu, 12 Jul 2018 11:30:53 +0200",
        "Message-Id": "<2cc2794bf1301975f3af6691ffc1c888355ecfcc.1531387413.git.nelio.laranjeiro@6wind.com>",
        "X-Mailer": "git-send-email 2.18.0",
        "In-Reply-To": "<cover.1531387413.git.nelio.laranjeiro@6wind.com>",
        "References": "<cover.1531293415.git.nelio.laranjeiro@6wind.com>\n\t<cover.1531387413.git.nelio.laranjeiro@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH v4 07/21] net/mlx5: add flow VLAN item",
        "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": "Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>\nAcked-by: Yongseok Koh <yskoh@mellanox.com>\n---\n drivers/net/mlx5/mlx5_flow.c | 127 +++++++++++++++++++++++++++++++++++\n 1 file changed, 127 insertions(+)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex 77f1bd5cc..659979283 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -382,6 +382,130 @@ mlx5_flow_item_eth(const struct rte_flow_item *item, struct rte_flow *flow,\n \treturn size;\n }\n \n+/**\n+ * Update the VLAN tag in the Verbs Ethernet specification.\n+ *\n+ * @param[in, out] attr\n+ *   Pointer to Verbs attributes structure.\n+ * @param[in] eth\n+ *   Verbs structure containing the VLAN information to copy.\n+ */\n+static void\n+mlx5_flow_item_vlan_update(struct ibv_flow_attr *attr,\n+\t\t\t   struct ibv_flow_spec_eth *eth)\n+{\n+\tunsigned int i;\n+\tenum ibv_flow_spec_type search = IBV_FLOW_SPEC_ETH;\n+\tstruct ibv_spec_header *hdr = (struct ibv_spec_header *)\n+\t\t((uint8_t *)attr + sizeof(struct ibv_flow_attr));\n+\n+\tfor (i = 0; i != attr->num_of_specs; ++i) {\n+\t\tif (hdr->type == search) {\n+\t\t\tstruct ibv_flow_spec_eth *e =\n+\t\t\t\t(struct ibv_flow_spec_eth *)hdr;\n+\n+\t\t\te->val.vlan_tag = eth->val.vlan_tag;\n+\t\t\te->mask.vlan_tag = eth->mask.vlan_tag;\n+\t\t\te->val.ether_type = eth->val.ether_type;\n+\t\t\te->mask.ether_type = eth->mask.ether_type;\n+\t\t\tbreak;\n+\t\t}\n+\t\thdr = (struct ibv_spec_header *)((uint8_t *)hdr + hdr->size);\n+\t}\n+}\n+\n+/**\n+ * Convert the @p item into @p flow (or by updating the already present\n+ * Ethernet Verbs) specification after ensuring the NIC will understand and\n+ * 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_vlan(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_vlan *spec = item->spec;\n+\tconst struct rte_flow_item_vlan *mask = item->mask;\n+\tconst struct rte_flow_item_vlan nic_mask = {\n+\t\t.tci = RTE_BE16(0x0fff),\n+\t\t.inner_type = RTE_BE16(0xffff),\n+\t};\n+\tunsigned int size = sizeof(struct ibv_flow_spec_eth);\n+\tstruct ibv_flow_spec_eth eth = {\n+\t\t.type = IBV_FLOW_SPEC_ETH,\n+\t\t.size = size,\n+\t};\n+\tint ret;\n+\tconst uint32_t l34m = MLX5_FLOW_LAYER_OUTER_L3 |\n+\t\t\tMLX5_FLOW_LAYER_OUTER_L4;\n+\tconst uint32_t vlanm = MLX5_FLOW_LAYER_OUTER_VLAN;\n+\tconst uint32_t l2m = MLX5_FLOW_LAYER_OUTER_L2;\n+\n+\tif (flow->layers & vlanm)\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  \"VLAN layer already configured\");\n+\telse if ((flow->layers & l34m) != 0)\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  \"L2 layer cannot follow L3/L4 layer\");\n+\tif (!mask)\n+\t\tmask = &rte_flow_item_vlan_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_vlan), error);\n+\tif (ret)\n+\t\treturn ret;\n+\tif (spec) {\n+\t\teth.val.vlan_tag = spec->tci;\n+\t\teth.mask.vlan_tag = mask->tci;\n+\t\teth.val.vlan_tag &= eth.mask.vlan_tag;\n+\t\teth.val.ether_type = spec->inner_type;\n+\t\teth.mask.ether_type = mask->inner_type;\n+\t\teth.val.ether_type &= eth.mask.ether_type;\n+\t}\n+\t/*\n+\t * From verbs perspective an empty VLAN is equivalent\n+\t * to a packet without VLAN layer.\n+\t */\n+\tif (!eth.mask.vlan_tag)\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ITEM_SPEC,\n+\t\t\t\t\t  item->spec,\n+\t\t\t\t\t  \"VLAN cannot be empty\");\n+\tif (!(flow->layers & l2m)) {\n+\t\tif (size <= flow_size)\n+\t\t\tmlx5_flow_spec_verbs_add(flow, &eth, size);\n+\t} else {\n+\t\tif (flow->verbs.attr)\n+\t\t\tmlx5_flow_item_vlan_update(flow->verbs.attr, &eth);\n+\t\tsize = 0; /* Only an update is done in eth specification. */\n+\t}\n+\tflow->layers |= MLX5_FLOW_LAYER_OUTER_L2 |\n+\t\tMLX5_FLOW_LAYER_OUTER_VLAN;\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@@ -424,6 +548,9 @@ mlx5_flow_items(const struct rte_flow_item pattern[],\n \t\tcase RTE_FLOW_ITEM_TYPE_ETH:\n \t\t\tret = mlx5_flow_item_eth(pattern, flow, remain, error);\n \t\t\tbreak;\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\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",
        "07/21"
    ]
}