get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64764,
    "url": "http://patchwork.dpdk.org/api/patches/64764/",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/87ca94513977186064949d272c5785597f664d20.1579168182.git.jackmin@mellanox.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<87ca94513977186064949d272c5785597f664d20.1579168182.git.jackmin@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/87ca94513977186064949d272c5785597f664d20.1579168182.git.jackmin@mellanox.com",
    "date": "2020-01-16T10:14:14",
    "name": "[2/5] net/mlx5: support flow dump API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "31769c2037f317464e0377348c97668e01eaf7e6",
    "submitter": {
        "id": 1065,
        "url": "http://patchwork.dpdk.org/api/people/1065/",
        "name": "Xiaoyu Min",
        "email": "jackmin@mellanox.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/87ca94513977186064949d272c5785597f664d20.1579168182.git.jackmin@mellanox.com/mbox/",
    "series": [
        {
            "id": 8154,
            "url": "http://patchwork.dpdk.org/api/series/8154/",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=8154",
            "date": "2020-01-16T10:14:12",
            "name": "ethdev: add API to dump device internal flow info",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/8154/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/64764/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/64764/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 67FD5A0352;\n\tThu, 16 Jan 2020 11:15:58 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 378BC1C1EA;\n\tThu, 16 Jan 2020 11:15:48 +0100 (CET)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id 4376A1C1DE\n for <dev@dpdk.org>; Thu, 16 Jan 2020 11:15:44 +0100 (CET)"
        ],
        "X-Mailman-Version": "2.1.15",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "To": "jerinjacobk@gmail.com, orika@mellanox.com, viacheslavo@mellanox.com,\n matan@mellanox.com, rasland@mellanox.com,\n Shahaf Shuler <shahafs@mellanox.com>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "References": "<cover.1579168182.git.jackmin@mellanox.com>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Content-Transfer-Encoding": "8bit",
        "Message-Id": "\n <87ca94513977186064949d272c5785597f664d20.1579168182.git.jackmin@mellanox.com>",
        "Precedence": "list",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH 2/5] net/mlx5: support flow dump API",
        "MIME-Version": "1.0",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Date": "Thu, 16 Jan 2020 12:14:14 +0200",
        "In-Reply-To": "<cover.1579168182.git.jackmin@mellanox.com>",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailer": "git-send-email 2.21.0",
        "Errors-To": "dev-bounces@dpdk.org",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Cc": "dev@dpdk.org,\n\tXueming Li <xuemingl@mellanox.com>",
        "From": "Xiaoyu Min <jackmin@mellanox.com>"
    },
    "content": "Dump fdb/nic_rx/nic_tx raw flow data into specified file.\n\nSigned-off-by: Xueming Li <xuemingl@mellanox.com>\nSigned-off-by: Xiaoyu Min <jackmin@mellanox.com>\n---\n drivers/net/mlx5/Makefile         |  7 ++++++-\n drivers/net/mlx5/meson.build      |  2 ++\n drivers/net/mlx5/mlx5.h           |  4 ++++\n drivers/net/mlx5/mlx5_devx_cmds.c | 35 +++++++++++++++++++++++++++++++\n drivers/net/mlx5/mlx5_flow.c      | 24 +++++++++++++++++++++\n drivers/net/mlx5/mlx5_glue.c      | 13 ++++++++++++\n drivers/net/mlx5/mlx5_glue.h      |  1 +\n 7 files changed, 85 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile\nindex c5cf4397ac..6e5921b292 100644\n--- a/drivers/net/mlx5/Makefile\n+++ b/drivers/net/mlx5/Makefile\n@@ -8,7 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk\n LIB = librte_pmd_mlx5.a\n LIB_GLUE = $(LIB_GLUE_BASE).$(LIB_GLUE_VERSION)\n LIB_GLUE_BASE = librte_pmd_mlx5_glue.so\n-LIB_GLUE_VERSION = 19.08.0\n+LIB_GLUE_VERSION = 19.11.0\n \n # Sources.\n SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5.c\n@@ -203,6 +203,11 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh\n \t\tinfiniband/mlx5dv.h \\\n \t\tfunc mlx5dv_dr_action_create_flow_meter \\\n \t\t$(AUTOCONF_OUTPUT)\n+\t$Q sh -- '$<' '$@' \\\n+\t\tHAVE_MLX5_DR_FLOW_DUMP \\\n+\t\tinfiniband/mlx5dv.h \\\n+\t\tfunc mlx5dv_dump_dr_domain \\\n+\t\t$(AUTOCONF_OUTPUT)\n \t$Q sh -- '$<' '$@' \\\n \t\tHAVE_MLX5DV_MMAP_GET_NC_PAGES_CMD \\\n \t\tinfiniband/mlx5dv.h \\\ndiff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build\nindex d6b32db794..d7ef032afb 100644\n--- a/drivers/net/mlx5/meson.build\n+++ b/drivers/net/mlx5/meson.build\n@@ -186,6 +186,8 @@ if build\n \t\t'RDMA_NLDEV_ATTR_PORT_INDEX' ],\n \t\t[ 'HAVE_RDMA_NLDEV_ATTR_NDEV_INDEX', 'rdma/rdma_netlink.h',\n \t\t'RDMA_NLDEV_ATTR_NDEV_INDEX' ],\n+\t\t[ 'HAVE_MLX5_DR_FLOW_DUMP', 'infiniband/mlx5dv.h',\n+\t\t'mlx5dv_dump_dr_domain'],\n \t]\n \tconfig = configuration_data()\n \tforeach arg:has_sym_args\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex c3df8256ce..047181b32e 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -975,6 +975,8 @@ struct mlx5_flow_counter *mlx5_counter_alloc(struct rte_eth_dev *dev);\n void mlx5_counter_free(struct rte_eth_dev *dev, struct mlx5_flow_counter *cnt);\n int mlx5_counter_query(struct rte_eth_dev *dev, struct mlx5_flow_counter *cnt,\n \t\t       bool clear, uint64_t *pkts, uint64_t *bytes);\n+int mlx5_flow_dev_dump(struct rte_eth_dev *dev, FILE *file,\n+\t\t       struct rte_flow_error *error);\n \n /* mlx5_mp.c */\n void mlx5_mp_req_start_rxtx(struct rte_eth_dev *dev);\n@@ -1049,6 +1051,8 @@ struct mlx5_devx_obj *mlx5_devx_cmd_create_tis\n \t(struct ibv_context *ctx, struct mlx5_devx_tis_attr *tis_attr);\n struct mlx5_devx_obj *mlx5_devx_cmd_create_td(struct ibv_context *ctx);\n \n+int mlx5_devx_cmd_flow_dump(struct mlx5_ibv_shared *sh, FILE *file);\n+\n /* mlx5_flow_meter.c */\n \n int mlx5_flow_meter_ops_get(struct rte_eth_dev *dev, void *arg);\ndiff --git a/drivers/net/mlx5/mlx5_devx_cmds.c b/drivers/net/mlx5/mlx5_devx_cmds.c\nindex 9893287ba8..d6bf15689d 100644\n--- a/drivers/net/mlx5/mlx5_devx_cmds.c\n+++ b/drivers/net/mlx5/mlx5_devx_cmds.c\n@@ -927,3 +927,38 @@ mlx5_devx_cmd_create_td(struct ibv_context *ctx)\n \t\t\t   transport_domain);\n \treturn td;\n }\n+\n+/**\n+ * Dump all flows to file.\n+ *\n+ * @param[in] sh\n+ *   Pointer to context.\n+ * @param[out] file\n+ *   Pointer to file stream.\n+ *\n+ * @return\n+ *   0 on success, a nagative value otherwise.\n+ */\n+int\n+mlx5_devx_cmd_flow_dump(struct mlx5_ibv_shared *sh __rte_unused,\n+\t\t\tFILE *file __rte_unused)\n+{\n+\tint ret = 0;\n+\n+#ifdef HAVE_MLX5_DR_FLOW_DUMP\n+\tif (sh->fdb_domain) {\n+\t\tret = mlx5_glue->dr_dump_domain(file, sh->fdb_domain);\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\t}\n+\tassert(sh->rx_domain);\n+\tret = mlx5_glue->dr_dump_domain(file, sh->rx_domain);\n+\tif (ret)\n+\t\treturn ret;\n+\tassert(sh->tx_domain);\n+\tret = mlx5_glue->dr_dump_domain(file, sh->tx_domain);\n+#else\n+\tret = ENOTSUP;\n+#endif\n+\treturn -ret;\n+}\ndiff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex cb9d265f6f..0126cd8f92 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -236,6 +236,7 @@ static const struct rte_flow_ops mlx5_flow_ops = {\n \t.flush = mlx5_flow_flush,\n \t.isolate = mlx5_flow_isolate,\n \t.query = mlx5_flow_query,\n+\t.dev_dump = mlx5_flow_dev_dump,\n };\n \n /* Convert FDIR request to Generic flow. */\n@@ -5679,3 +5680,26 @@ mlx5_flow_discover_mreg_c(struct rte_eth_dev *dev)\n \t\tconfig->flow_mreg_c[n] = REG_NONE;\n \treturn 0;\n }\n+\n+/**\n+ * Dump flow raw hw data to file\n+ *\n+ * @param[in] dev\n+ *    The pointer to Ethernet device.\n+ * @param[in] file\n+ *   A pointer to a file for output.\n+ * @param[out] error\n+ *   Perform verbose error reporting if not NULL. PMDs initialize this\n+ *   structure in case of error only.\n+ * @return\n+ *   0 on success, a nagative value otherwise.\n+ */\n+int\n+mlx5_flow_dev_dump(struct rte_eth_dev *dev,\n+\t\t   FILE *file,\n+\t\t   struct rte_flow_error *error __rte_unused)\n+{\n+\tstruct mlx5_priv *priv = dev->data->dev_private;\n+\n+\treturn mlx5_devx_cmd_flow_dump(priv->sh, file);\n+}\ndiff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c\nindex 0917bf28d6..4906eebc01 100644\n--- a/drivers/net/mlx5/mlx5_glue.c\n+++ b/drivers/net/mlx5/mlx5_glue.c\n@@ -1037,6 +1037,18 @@ mlx5_glue_devx_port_query(struct ibv_context *ctx,\n #endif\n }\n \n+static int\n+mlx5_glue_dr_dump_domain(FILE *file, void *domain)\n+{\n+#ifdef HAVE_MLX5_DR_FLOW_DUMP\n+\treturn mlx5dv_dump_dr_domain(file, domain);\n+#else\n+\tRTE_SET_USED(file);\n+\tRTE_SET_USED(domain);\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n alignas(RTE_CACHE_LINE_SIZE)\n const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){\n \t.version = MLX5_GLUE_VERSION,\n@@ -1134,4 +1146,5 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){\n \t.devx_umem_dereg = mlx5_glue_devx_umem_dereg,\n \t.devx_qp_query = mlx5_glue_devx_qp_query,\n \t.devx_port_query = mlx5_glue_devx_port_query,\n+\t.dr_dump_domain = mlx5_glue_dr_dump_domain,\n };\ndiff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h\nindex 6442f1eba8..6771a18c64 100644\n--- a/drivers/net/mlx5/mlx5_glue.h\n+++ b/drivers/net/mlx5/mlx5_glue.h\n@@ -256,6 +256,7 @@ struct mlx5_glue {\n \tint (*devx_port_query)(struct ibv_context *ctx,\n \t\t\t       uint32_t port_num,\n \t\t\t       struct mlx5dv_devx_port *mlx5_devx_port);\n+\tint (*dr_dump_domain)(FILE *file, void *domain);\n };\n \n const struct mlx5_glue *mlx5_glue;\n",
    "prefixes": [
        "2/5"
    ]
}