get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 91415,
    "url": "https://patches.dpdk.org/api/patches/91415/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1618384952-179763-3-git-send-email-haifeil@nvidia.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1618384952-179763-3-git-send-email-haifeil@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1618384952-179763-3-git-send-email-haifeil@nvidia.com",
    "date": "2021-04-14T07:22:32",
    "name": "[2/2] net/mlx5: add mlx5 APIs for single flow dump feature",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "150a49b1474251301838406f5663f2235c22e73d",
    "submitter": {
        "id": 2131,
        "url": "https://patches.dpdk.org/api/people/2131/?format=api",
        "name": "Haifei Luo",
        "email": "haifeil@nvidia.com"
    },
    "delegate": {
        "id": 3268,
        "url": "https://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1618384952-179763-3-git-send-email-haifeil@nvidia.com/mbox/",
    "series": [
        {
            "id": 16359,
            "url": "https://patches.dpdk.org/api/series/16359/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=16359",
            "date": "2021-04-14T07:22:31",
            "name": "support single flow dump on MLX5 PMD",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/16359/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/91415/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/91415/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 4A072A0524;\n\tWed, 14 Apr 2021 09:22:47 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id F1058161759;\n\tWed, 14 Apr 2021 09:22:42 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by mails.dpdk.org (Postfix) with ESMTP id 70D45161750\n for <dev@dpdk.org>; Wed, 14 Apr 2021 09:22:40 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n haifeil@nvidia.com) with SMTP; 14 Apr 2021 10:22:39 +0300",
            "from nvidia.com (gen-l-vrt-173.mtl.labs.mlnx [10.234.173.1])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 13E7Mbb7022309;\n Wed, 14 Apr 2021 10:22:39 +0300"
        ],
        "From": "Haifei Luo <haifeil@nvidia.com>",
        "To": "ferruh.yigit@intel.com, viacheslavo@nvidia.com, matan@nvidia.com,\n xiaoyun.li@intel.com, thomas@monjalon.net, orika@nvidia.com",
        "Cc": "dev@dpdk.org, rasland@nvidia.com, xuemingl@nvidia.com, haifeil@nvidia.com",
        "Date": "Wed, 14 Apr 2021 10:22:32 +0300",
        "Message-Id": "<1618384952-179763-3-git-send-email-haifeil@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1618384952-179763-1-git-send-email-haifeil@nvidia.com>",
        "References": "<1618384952-179763-1-git-send-email-haifeil@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH 2/2] net/mlx5: add mlx5 APIs for single flow dump\n feature",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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": "Modify API mlx5_flow_dev_dump to support the feature.\nModify mlx5_socket since one extra arg flow_ptr is added.\n\nSigned-off-by: Haifei Luo <haifeil@nvidia.com>\n---\n drivers/net/mlx5/linux/mlx5_socket.c | 30 ++++++++++++++++++++++++------\n drivers/net/mlx5/mlx5_flow.c         | 30 ++++++++++++++++++++++++++++--\n 2 files changed, 52 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/linux/mlx5_socket.c b/drivers/net/mlx5/linux/mlx5_socket.c\nindex 6e354f4..b6eff45 100644\n--- a/drivers/net/mlx5/linux/mlx5_socket.c\n+++ b/drivers/net/mlx5/linux/mlx5_socket.c\n@@ -2,6 +2,10 @@\n  * Copyright 2019 Mellanox Technologies, Ltd\n  */\n \n+#ifndef _GNU_SOURCE\n+#define _GNU_SOURCE\n+#endif\n+\n #include <sys/types.h>\n #include <sys/socket.h>\n #include <sys/un.h>\n@@ -29,11 +33,15 @@\n {\n \tint conn_sock;\n \tint ret;\n+\tint j;\n \tstruct cmsghdr *cmsg = NULL;\n-\tint data;\n+\t#define LENGTH 9\n+\t/* The first int for port_id and the rest for flowptr. */\n+\tint data[LENGTH];\n+\tuint64_t flow_ptr = 0;\n \tchar buf[CMSG_SPACE(sizeof(int))] = { 0 };\n \tstruct iovec io = {\n-\t\t.iov_base = &data,\n+\t\t.iov_base = &data[0],\n \t\t.iov_len = sizeof(data),\n \t};\n \tstruct msghdr msg = {\n@@ -46,7 +54,9 @@\n \tint fd;\n \tFILE *file = NULL;\n \tstruct rte_eth_dev *dev;\n+\tstruct rte_flow_error err;\n \n+\tmemset(data, 0, sizeof(data));\n \t/* Accept the connection from the client. */\n \tconn_sock = accept(server_socket, NULL, NULL);\n \tif (conn_sock < 0) {\n@@ -84,15 +94,23 @@\n \t}\n \t/* Dump flow. */\n \tdev = &rte_eth_devices[port_id];\n-\tret = mlx5_flow_dev_dump(dev, NULL, file, NULL);\n+\t/* The first in data for port_id and the following 8 for flowptr */\n+\tfor (j = 1; j < LENGTH; j++)\n+\t\tflow_ptr = (flow_ptr << 8) + data[j];\n+\tif (flow_ptr == 0)\n+\t\tret = mlx5_flow_dev_dump(dev, NULL, file, NULL);\n+\telse\n+\t\tret = mlx5_flow_dev_dump(dev,\n+\t\t\t(struct rte_flow *)((uintptr_t)flow_ptr), file, &err);\n+\n \t/* Set-up the ancillary data and reply. */\n \tmsg.msg_controllen = 0;\n \tmsg.msg_control = NULL;\n \tmsg.msg_iovlen = 1;\n \tmsg.msg_iov = &io;\n-\tdata = -ret;\n-\tio.iov_len = sizeof(data);\n-\tio.iov_base = &data;\n+\tdata[0] = -ret;\n+\tio.iov_len = sizeof(data[0]);\n+\tio.iov_base = &data[0];\n \tdo {\n \t\tret = sendmsg(conn_sock, &msg, 0);\n \t} while (ret < 0 && errno == EINTR);\ndiff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex a8cf674..36089d4 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -7160,6 +7160,10 @@ struct mlx5_meter_domains_infos *\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct mlx5_dev_ctx_shared *sh = priv->sh;\n+\tuint32_t handle_idx;\n+\tint ret;\n+\tstruct mlx5_flow_handle *dh;\n+\tstruct rte_flow *flow;\n \n \tif (!priv->config.dv_flow_en) {\n \t\tif (fputs(\"device dv flow disabled\\n\", file) <= 0)\n@@ -7167,10 +7171,32 @@ struct mlx5_meter_domains_infos *\n \t\treturn -ENOTSUP;\n \t}\n \n+\t/* dump all */\n \tif (!flow_idx)\n \t\treturn mlx5_devx_cmd_flow_dump(sh->fdb_domain,\n-\t\t\t\tsh->rx_domain, sh->tx_domain, file);\n-\treturn -ENOTSUP;\n+\t\t\t\t\tsh->rx_domain,\n+\t\t\t\t\tsh->tx_domain, file);\n+\t/* dump one */\n+\tflow = mlx5_ipool_get(priv->sh->ipool\n+\t\t\t[MLX5_IPOOL_RTE_FLOW], (uintptr_t)(void *)flow_idx);\n+\tif (!flow)\n+\t\treturn -ENOENT;\n+\n+\thandle_idx = flow->dev_handles;\n+\twhile (handle_idx) {\n+\t\tdh = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_MLX5_FLOW],\n+\t\t\t\thandle_idx);\n+\t\tif (!dh)\n+\t\t\treturn -ENOENT;\n+\t\tif (dh->drv_flow) {\n+\t\t\tret = mlx5_devx_cmd_flow_single_dump(dh->drv_flow,\n+\t\t\t\t\tfile);\n+\t\t\tif (ret)\n+\t\t\t\treturn -ENOENT;\n+\t\t}\n+\t\thandle_idx = dh->next.next;\n+\t}\n+\treturn 0;\n }\n \n /**\n",
    "prefixes": [
        "2/2"
    ]
}