Show a patch.

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

{
    "id": 44071,
    "url": "http://patches.dpdk.org/api/patches/44071/",
    "web_url": "http://patches.dpdk.org/patch/44071/",
    "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": "<20180831085337.21419-5-adrien.mazarguil@6wind.com>",
    "date": "2018-08-31T09:01:07",
    "name": "[v3,4/7] net/failsafe: switch to flow API object conversion function",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a62e5c34d23b06f24ba57074a7807a4a1290ae2d",
    "submitter": {
        "id": 165,
        "url": "http://patches.dpdk.org/api/people/165/",
        "name": "Adrien Mazarguil",
        "email": "adrien.mazarguil@6wind.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "http://patches.dpdk.org/patch/44071/mbox/",
    "series": [
        {
            "id": 1123,
            "url": "http://patches.dpdk.org/api/series/1123/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1123",
            "date": "2018-08-31T09:00:57",
            "name": "ethdev: add flow API object converter",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/1123/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44071/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44071/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "In-Reply-To": "<20180831085337.21419-1-adrien.mazarguil@6wind.com>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Mailer": "git-send-email 2.11.0",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C249A4F94;\n\tFri, 31 Aug 2018 11:01:30 +0200 (CEST)",
            "from mail-wm0-f46.google.com (mail-wm0-f46.google.com\n\t[74.125.82.46]) by dpdk.org (Postfix) with ESMTP id EFEB34C88\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 11:01:23 +0200 (CEST)",
            "by mail-wm0-f46.google.com with SMTP id b19-v6so4475406wme.3\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 02:01:23 -0700 (PDT)",
            "from 6wind.com (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\tb124-v6sm3385141wmh.17.2018.08.31.02.01.22\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 31 Aug 2018 02:01:22 -0700 (PDT)"
        ],
        "References": "<20180803132032.29038-1-adrien.mazarguil@6wind.com>\n\t<20180831085337.21419-1-adrien.mazarguil@6wind.com>",
        "X-Google-Smtp-Source": "ANB0Vdb1tpe3cleUo2Sbvg71Mjqn9JhzppTWUFh0xSndrSRpyfIR3i6hHKBFs8r4ssSyfERSPI2Waw==",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to;\n\tbh=PtvSO8AnfduGqjsbwqMjjOWkPQJnQbptU1MYVAkL/8g=;\n\tb=QXGp5c9e2vNk7V3sdgDfynfT9yvLPdaqEy/12/Zk6ju+U7kJSRbRq/tgFkzAcHQtUS\n\tdGf7nVKWJXjTsWp7m7ChlPjyeaVpr+WZqEfVpIiM45eHbif5/H4rVV4QkIPPNZAFnwrP\n\t/iBTna04Byp1QIYJXHcybI/rcl1p/Yh2x5rX3MOOk/l4Wko1sSn4yBtiAvhJR2mAU1s3\n\tBB5uqaVVs7hZQIGb57d7KsFx7MViNrg7sM/raNbHLM+Kdn+SS0qfY3+lTYYzxCx5bF6W\n\tZDVtZxC4F5y1cefUjareBObszLfYIVjjmF47EA4Y6h9ijOAmGJfrSte+RaWAXyFCJNYv\n\thAow==",
        "MIME-Version": "1.0",
        "X-Received": "by 2002:a1c:5f82:: with SMTP id\n\tt124-v6mr4212903wmb.14.1535706083688; \n\tFri, 31 Aug 2018 02:01:23 -0700 (PDT)",
        "Message-ID": "<20180831085337.21419-5-adrien.mazarguil@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:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to;\n\tbh=PtvSO8AnfduGqjsbwqMjjOWkPQJnQbptU1MYVAkL/8g=;\n\tb=Zt2C4PbHOUAFOLplkQ0XWuXHq316ly9q58hhdAJaN2N5SE50kvGZbq6pqR8mhyAhOw\n\t+Vv6+cfxNm319GgduGcITH9P/TpZ47+bYdBloa0S+Hu18M8MS7jpKURq+TlzjsV0SQrC\n\tIKDgHHxulRO4elsLqERMoMuQsgmP/V1fhs/GSaE5UTg79Kg5oLLUmDav+toYCyCH+rUu\n\tiWUutY4dtyHvVZCNsThA/tCSej5+hFxEEeeA9TBUcK8FDuzq7cwI54R4aRHLXkoyzgQt\n\tZQa6AGWSLUaOijl2QdunmwMfkDBJHEKDha0PZnBNCCAPsgyN6S+IONZwlBp9GhZNyjfM\n\tHv8Q==",
        "Delivered-To": "patchwork@dpdk.org",
        "Precedence": "list",
        "From": "Adrien Mazarguil <adrien.mazarguil@6wind.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "Content-Type": "text/plain; charset=us-ascii",
        "Content-Disposition": "inline",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "To": "Ferruh Yigit <ferruh.yigit@intel.com>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "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": "Fri, 31 Aug 2018 11:01:07 +0200",
        "X-Gm-Message-State": "APzg51BkS7LwqFUNSyHDvtVbtrrtOuAPCbu4wk5R0MSOouKzcjVBZFGX\n\tdzI7KMtjT5eJ1xXt9nEwZKIaQw==",
        "Cc": "dev@dpdk.org, Gaetan Rivet <gaetan.rivet@6wind.com>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-BeenThere": "dev@dpdk.org",
        "Subject": "[dpdk-dev] [PATCH v3 4/7] net/failsafe: switch to flow API object\n\tconversion function"
    },
    "content": "This patch replaces rte_flow_copy() with rte_flow_conv().\n\nSigned-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>\nCc: Gaetan Rivet <gaetan.rivet@6wind.com>\n--\nv2 changes:\n\n- Patch was split from \"ethdev: add flow API object converter\".\n---\n drivers/net/failsafe/failsafe_ether.c   |  6 +++---\n drivers/net/failsafe/failsafe_flow.c    | 31 +++++++++++++++++++++-------\n drivers/net/failsafe/failsafe_private.h |  5 ++++-\n 3 files changed, 31 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c\nindex 5b5cb3b49..8bce368f3 100644\n--- a/drivers/net/failsafe/failsafe_ether.c\n+++ b/drivers/net/failsafe/failsafe_ether.c\n@@ -230,9 +230,9 @@ fs_eth_dev_conf_apply(struct rte_eth_dev *dev,\n \t\t\tDEBUG(\"Creating flow #%\" PRIu32, i++);\n \t\t\tflow->flows[SUB_ID(sdev)] =\n \t\t\t\trte_flow_create(PORT_ID(sdev),\n-\t\t\t\t\t\t&flow->fd->attr,\n-\t\t\t\t\t\tflow->fd->items,\n-\t\t\t\t\t\tflow->fd->actions,\n+\t\t\t\t\t\tflow->rule.attr,\n+\t\t\t\t\t\tflow->rule.pattern,\n+\t\t\t\t\t\tflow->rule.actions,\n \t\t\t\t\t\t&ferror);\n \t\t\tret = rte_errno;\n \t\t\tif (ret)\ndiff --git a/drivers/net/failsafe/failsafe_flow.c b/drivers/net/failsafe/failsafe_flow.c\nindex bfe42fcee..5e2b5f7c6 100644\n--- a/drivers/net/failsafe/failsafe_flow.c\n+++ b/drivers/net/failsafe/failsafe_flow.c\n@@ -3,8 +3,11 @@\n  * Copyright 2017 Mellanox Technologies, Ltd\n  */\n \n+#include <stddef.h>\n+#include <string.h>\n #include <sys/queue.h>\n \n+#include <rte_errno.h>\n #include <rte_malloc.h>\n #include <rte_tailq.h>\n #include <rte_flow.h>\n@@ -18,19 +21,33 @@ fs_flow_allocate(const struct rte_flow_attr *attr,\n \t\t const struct rte_flow_action *actions)\n {\n \tstruct rte_flow *flow;\n-\tsize_t fdsz;\n+\tconst struct rte_flow_conv_rule rule = {\n+\t\t.attr_ro = attr,\n+\t\t.pattern_ro = items,\n+\t\t.actions_ro = actions,\n+\t};\n+\tstruct rte_flow_error error;\n+\tint ret;\n \n-\tfdsz = rte_flow_copy(NULL, 0, attr, items, actions);\n-\tflow = rte_zmalloc(NULL,\n-\t\t\t   sizeof(struct rte_flow) + fdsz,\n+\tret = rte_flow_conv(RTE_FLOW_CONV_OP_RULE, NULL, 0, &rule, &error);\n+\tif (ret < 0) {\n+\t\tERROR(\"Unable to process flow rule (%s): %s\",\n+\t\t      error.message ? error.message : \"unspecified\",\n+\t\t      strerror(rte_errno));\n+\t\treturn NULL;\n+\t}\n+\tflow = rte_zmalloc(NULL, offsetof(struct rte_flow, rule) + ret,\n \t\t\t   RTE_CACHE_LINE_SIZE);\n \tif (flow == NULL) {\n \t\tERROR(\"Could not allocate new flow\");\n \t\treturn NULL;\n \t}\n-\tflow->fd = (void *)((uintptr_t)flow + sizeof(*flow));\n-\tif (rte_flow_copy(flow->fd, fdsz, attr, items, actions) != fdsz) {\n-\t\tERROR(\"Failed to copy flow description\");\n+\tret = rte_flow_conv(RTE_FLOW_CONV_OP_RULE, &flow->rule, ret, &rule,\n+\t\t\t    &error);\n+\tif (ret < 0) {\n+\t\tERROR(\"Failed to copy flow rule (%s): %s\",\n+\t\t      error.message ? error.message : \"unspecified\",\n+\t\t      strerror(rte_errno));\n \t\trte_free(flow);\n \t\treturn NULL;\n \t}\ndiff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h\nindex 886af8616..cc1f0343d 100644\n--- a/drivers/net/failsafe/failsafe_private.h\n+++ b/drivers/net/failsafe/failsafe_private.h\n@@ -6,6 +6,7 @@\n #ifndef _RTE_ETH_FAILSAFE_PRIVATE_H_\n #define _RTE_ETH_FAILSAFE_PRIVATE_H_\n \n+#include <stdint.h>\n #include <sys/queue.h>\n #include <pthread.h>\n \n@@ -13,6 +14,7 @@\n #include <rte_dev.h>\n #include <rte_ethdev_driver.h>\n #include <rte_devargs.h>\n+#include <rte_flow.h>\n #include <rte_interrupts.h>\n \n #define FAILSAFE_DRIVER_NAME \"Fail-safe PMD\"\n@@ -81,7 +83,8 @@ struct rte_flow {\n \t/* sub_flows */\n \tstruct rte_flow *flows[FAILSAFE_MAX_ETHPORTS];\n \t/* flow description for synchronization */\n-\tstruct rte_flow_desc *fd;\n+\tstruct rte_flow_conv_rule rule;\n+\tuint8_t rule_data[];\n };\n \n enum dev_state {\n",
    "prefixes": [
        "v3",
        "4/7"
    ]
}