get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52769,
    "url": "http://patches.dpdk.org/api/patches/52769/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1555276357-4892-10-git-send-email-orika@mellanox.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": "<1555276357-4892-10-git-send-email-orika@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1555276357-4892-10-git-send-email-orika@mellanox.com",
    "date": "2019-04-14T21:12:37",
    "name": "[9/9] net/mlx5: add drop action to Direct Verbs E-Switch",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a9d87dda0ea84f9e432ad2031c6df49848bfca00",
    "submitter": {
        "id": 795,
        "url": "http://patches.dpdk.org/api/people/795/?format=api",
        "name": "Ori Kam",
        "email": "orika@mellanox.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/1555276357-4892-10-git-send-email-orika@mellanox.com/mbox/",
    "series": [
        {
            "id": 4308,
            "url": "http://patches.dpdk.org/api/series/4308/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4308",
            "date": "2019-04-14T21:12:28",
            "name": "net/mlx5: add Direct Verbs E-Switch support",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4308/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52769/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/52769/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 AA6A35F2E;\n\tSun, 14 Apr 2019 23:13:32 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id 22AA35B3C\n\tfor <dev@dpdk.org>; Sun, 14 Apr 2019 23:13:09 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n\torika@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 15 Apr 2019 00:13:02 +0300",
            "from pegasus03.mtr.labs.mlnx (pegasus03.mtr.labs.mlnx\n\t[10.210.16.124])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x3ELD10t027116;\n\tMon, 15 Apr 2019 00:13:02 +0300"
        ],
        "From": "Ori Kam <orika@mellanox.com>",
        "To": "yskoh@mellanox.com, shahafs@mellanox.com, matan@mellanox.com,\n\tviacheslavo@mellanox.com, motih@mellanox.com",
        "Cc": "dev@dpdk.org, orika@mellanox.com",
        "Date": "Sun, 14 Apr 2019 21:12:37 +0000",
        "Message-Id": "<1555276357-4892-10-git-send-email-orika@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1555276357-4892-1-git-send-email-orika@mellanox.com>",
        "References": "<1555276357-4892-1-git-send-email-orika@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 9/9] net/mlx5: add drop action to Direct Verbs\n\tE-Switch",
        "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": "This commit adds support for drop action when creating E-Switch flow\nusing DV.\n\nSigned-off-by: Ori Kam <orika@mellanox.com>\n---\n drivers/net/mlx5/mlx5.c         |  9 +++++++++\n drivers/net/mlx5/mlx5.h         |  1 +\n drivers/net/mlx5/mlx5_flow_dv.c | 26 ++++++++++++++++----------\n drivers/net/mlx5/mlx5_glue.c    | 12 ++++++++++++\n drivers/net/mlx5/mlx5_glue.h    |  1 +\n 5 files changed, 39 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 938ba1c..e3c6d24 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -357,6 +357,7 @@ struct mlx5_dev_spawn_data {\n \t\t\tgoto error;\n \t\t}\n \t\tsh->fdb_ns = ns;\n+\t\tsh->drop_action = mlx5_glue->dr_create_flow_action_drop();\n \t}\n #endif\n \tsh->dv_refcnt++;\n@@ -377,6 +378,10 @@ struct mlx5_dev_spawn_data {\n \t\tmlx5_glue->dr_destroy_ns(sh->fdb_ns);\n \t\tsh->fdb_ns = NULL;\n \t}\n+\tif (sh->drop_action) {\n+\t\tmlx5_glue->destroy_flow_action(sh->drop_action);\n+\t\tsh->drop_action = NULL;\n+\t}\n \treturn err;\n #else\n \t(void)priv;\n@@ -417,6 +422,10 @@ struct mlx5_dev_spawn_data {\n \t\tmlx5_glue->dr_destroy_ns(sh->fdb_ns);\n \t\tsh->fdb_ns = NULL;\n \t}\n+\tif (sh->drop_action) {\n+\t\tmlx5_glue->destroy_flow_action(sh->drop_action);\n+\t\tsh->drop_action = NULL;\n+\t}\n #endif\n \tpthread_mutex_destroy(&sh->dv_mutex);\n #else\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 016984d..fd85b9d 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -275,6 +275,7 @@ struct mlx5_ibv_shared {\n \t/* RX Direct Rules tables. */\n \tvoid *tx_ns; /* TX Direct Rules name space handle. */\n \tstruct mlx5_flow_tbl_resource tx_tbl[MLX5_MAX_TABLES];\n+\tvoid *drop_action; /* Pointer to drop action. */\n \t/* TX Direct Rules tables/ */\n \tLIST_HEAD(matchers, mlx5_flow_dv_matcher) matchers;\n \tLIST_HEAD(encap_decap, mlx5_flow_dv_encap_decap_resource) encaps_decaps;\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex d4dc439..4a8e894 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -4062,6 +4062,7 @@ struct field_modify_info modify_tcp[] = {\n {\n \tstruct mlx5_flow_dv *dv;\n \tstruct mlx5_flow *dev_flow;\n+\tstruct mlx5_priv *priv = dev->data->dev_private;\n \tint n;\n \tint err;\n \n@@ -4069,17 +4070,22 @@ struct field_modify_info modify_tcp[] = {\n \t\tdv = &dev_flow->dv;\n \t\tn = dv->actions_n;\n \t\tif (flow->actions & MLX5_FLOW_ACTION_DROP) {\n-\t\t\tdv->hrxq = mlx5_hrxq_drop_new(dev);\n-\t\t\tif (!dv->hrxq) {\n-\t\t\t\trte_flow_error_set\n-\t\t\t\t\t(error, errno,\n-\t\t\t\t\t RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n-\t\t\t\t\t \"cannot get drop hash queue\");\n-\t\t\t\tgoto error;\n+\t\t\tif (flow->transfer)\n+\t\t\t\tdv->actions[n++] = priv->sh->drop_action;\n+\t\t\telse {\n+\t\t\t\tdv->hrxq = mlx5_hrxq_drop_new(dev);\n+\t\t\t\tif (!dv->hrxq) {\n+\t\t\t\t\trte_flow_error_set\n+\t\t\t\t\t\t(error, errno,\n+\t\t\t\t\t\t RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t\t\t\t NULL,\n+\t\t\t\t\t\t \"cannot get drop hash queue\");\n+\t\t\t\t\tgoto error;\n+\t\t\t\t}\n+\t\t\t\tdv->actions[n++] =\n+\t\t\t\t\tmlx5_glue->dv_create_flow_action_dest_ibv_qp\n+\t\t\t\t\t(dv->hrxq->qp);\n \t\t\t}\n-\t\t\tdv->actions[n++] =\n-\t\t\t\tmlx5_glue->dv_create_flow_action_dest_ibv_qp\n-\t\t\t\t(dv->hrxq->qp);\n \t\t} else if (flow->actions &\n \t\t\t   (MLX5_FLOW_ACTION_QUEUE | MLX5_FLOW_ACTION_RSS)) {\n \t\t\tstruct mlx5_hrxq *hrxq;\ndiff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c\nindex 117190f..b32cd09c 100644\n--- a/drivers/net/mlx5/mlx5_glue.c\n+++ b/drivers/net/mlx5/mlx5_glue.c\n@@ -394,6 +394,16 @@\n }\n \n static void *\n+mlx5_glue_dr_create_flow_action_drop(void)\n+{\n+#ifdef HAVE_MLX5DV_DR_ESWITCH\n+\treturn mlx5dv_dr_create_action_drop();\n+#else\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n mlx5_glue_dr_create_flow_tbl(void *ns, uint32_t level)\n {\n #ifdef HAVE_MLX5DV_DR\n@@ -861,6 +871,8 @@\n \t\tmlx5_glue_dr_create_flow_action_dest_flow_tbl,\n \t.dr_create_flow_action_dest_vport =\n \t\tmlx5_glue_dr_create_flow_action_dest_vport,\n+\t.dr_create_flow_action_drop =\n+\t\tmlx5_glue_dr_create_flow_action_drop,\n \t.dr_create_flow_tbl = mlx5_glue_dr_create_flow_tbl,\n \t.dr_destroy_flow_tbl = mlx5_glue_dr_destroy_flow_tbl,\n \t.dr_create_ns = mlx5_glue_dr_create_ns,\ndiff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h\nindex 26f5cb3..1d06583 100644\n--- a/drivers/net/mlx5/mlx5_glue.h\n+++ b/drivers/net/mlx5/mlx5_glue.h\n@@ -147,6 +147,7 @@ struct mlx5_glue {\n \tstruct ibv_cq *(*cq_ex_to_cq)(struct ibv_cq_ex *cq);\n \tvoid *(*dr_create_flow_action_dest_flow_tbl)(void *tbl);\n \tvoid *(*dr_create_flow_action_dest_vport)(void *ns, uint32_t vport);\n+\tvoid *(*dr_create_flow_action_drop)();\n \tvoid *(*dr_create_flow_tbl)(void *ns, uint32_t level);\n \tint (*dr_destroy_flow_tbl)(void *tbl);\n \tvoid *(*dr_create_ns)(struct ibv_context *ctx,\n",
    "prefixes": [
        "9/9"
    ]
}