get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52915,
    "url": "http://patches.dpdk.org/api/patches/52915/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1555586930-109097-9-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": "<1555586930-109097-9-git-send-email-orika@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1555586930-109097-9-git-send-email-orika@mellanox.com",
    "date": "2019-04-18T11:28:49",
    "name": "[v2,8/9] net/mlx5: add Forward Database table type",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "23314e705643ce2c7ce1e81fb104759f1bd37282",
    "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/1555586930-109097-9-git-send-email-orika@mellanox.com/mbox/",
    "series": [
        {
            "id": 4373,
            "url": "http://patches.dpdk.org/api/series/4373/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4373",
            "date": "2019-04-18T11:28:44",
            "name": "net/mlx5: add Direct Verbs E-Switch support",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/4373/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52915/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/52915/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 2FE5E1B9B5;\n\tThu, 18 Apr 2019 13:29:23 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id A62041B96E\n\tfor <dev@dpdk.org>; Thu, 18 Apr 2019 13:29:05 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n\torika@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 18 Apr 2019 14:28:59 +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 x3IBSwk2024378;\n\tThu, 18 Apr 2019 14:28:59 +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": "Thu, 18 Apr 2019 11:28:49 +0000",
        "Message-Id": "<1555586930-109097-9-git-send-email-orika@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1555586930-109097-1-git-send-email-orika@mellanox.com>",
        "References": "<1555276357-4892-1-git-send-email-orika@mellanox.com>\n\t<1555586930-109097-1-git-send-email-orika@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v2 8/9] net/mlx5: add Forward Database table type",
        "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": "Actions like encap/decap, modify header require setting the flow table\ntype. Until now we supported only Nic RX and Nic TX, this commits adds\nthe support for FDB table type for those actions.\n\nSigned-off-by: Ori Kam <orika@mellanox.com>\n---\nv2:\n* Address ML comments.\n---\n drivers/net/mlx5/mlx5_flow_dv.c | 56 +++++++++++++++++++++++++++++------------\n 1 file changed, 40 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 9c5826c..5997182 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -40,6 +40,10 @@\n #define MLX5DV_FLOW_ACTION_COUNTERS_DEVX 0\n #endif\n \n+#ifndef HAVE_MLX5DV_DR_ESWITCH\n+#define MLX5DV_FLOW_TABLE_TYPE_FDB 0\n+#endif\n+\n union flow_dv_attr {\n \tstruct {\n \t\tuint32_t valid:1;\n@@ -939,7 +943,9 @@ struct field_modify_info modify_tcp[] = {\n \tstruct mlx5dv_dr_ns *ns;\n \n \tresource->flags = flow->group ? 0 : 1;\n-\tif (flow->ingress)\n+\tif (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_FDB)\n+\t\tns = sh->fdb_ns;\n+\telse if (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_NIC_RX)\n \t\tns = sh->rx_ns;\n \telse\n \t\tns = sh->tx_ns;\n@@ -1360,6 +1366,8 @@ struct field_modify_info modify_tcp[] = {\n  *   Pointer to action structure.\n  * @param[in, out] dev_flow\n  *   Pointer to the mlx5_flow.\n+ * @param[in] transfer\n+ *   Mark if the flow is E-Switch flow.\n  * @param[out] error\n  *   Pointer to the error structure.\n  *\n@@ -1370,6 +1378,7 @@ struct field_modify_info modify_tcp[] = {\n flow_dv_create_action_l2_encap(struct rte_eth_dev *dev,\n \t\t\t       const struct rte_flow_action *action,\n \t\t\t       struct mlx5_flow *dev_flow,\n+\t\t\t       uint8_t transfer,\n \t\t\t       struct rte_flow_error *error)\n {\n \tconst struct rte_flow_item *encap_data;\n@@ -1377,7 +1386,8 @@ struct field_modify_info modify_tcp[] = {\n \tstruct mlx5_flow_dv_encap_decap_resource res = {\n \t\t.reformat_type =\n \t\t\tMLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL,\n-\t\t.ft_type = MLX5DV_FLOW_TABLE_TYPE_NIC_TX,\n+\t\t.ft_type = transfer ? MLX5DV_FLOW_TABLE_TYPE_FDB :\n+\t\t\t\t      MLX5DV_FLOW_TABLE_TYPE_NIC_TX,\n \t};\n \n \tif (action->type == RTE_FLOW_ACTION_TYPE_RAW_ENCAP) {\n@@ -1412,6 +1422,8 @@ struct field_modify_info modify_tcp[] = {\n  *   Pointer to rte_eth_dev structure.\n  * @param[in, out] dev_flow\n  *   Pointer to the mlx5_flow.\n+ * @param[in] transfer\n+ *   Mark if the flow is E-Switch flow.\n  * @param[out] error\n  *   Pointer to the error structure.\n  *\n@@ -1421,13 +1433,15 @@ struct field_modify_info modify_tcp[] = {\n static int\n flow_dv_create_action_l2_decap(struct rte_eth_dev *dev,\n \t\t\t       struct mlx5_flow *dev_flow,\n+\t\t\t       uint8_t transfer,\n \t\t\t       struct rte_flow_error *error)\n {\n \tstruct mlx5_flow_dv_encap_decap_resource res = {\n \t\t.size = 0,\n \t\t.reformat_type =\n \t\t\tMLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TUNNEL_TO_L2,\n-\t\t.ft_type = MLX5DV_FLOW_TABLE_TYPE_NIC_RX,\n+\t\t.ft_type = transfer ? MLX5DV_FLOW_TABLE_TYPE_FDB :\n+\t\t\t\t      MLX5DV_FLOW_TABLE_TYPE_NIC_RX,\n \t};\n \n \tif (flow_dv_encap_decap_resource_register(dev, &res, dev_flow, error))\n@@ -1470,8 +1484,11 @@ struct field_modify_info modify_tcp[] = {\n \tres.reformat_type = attr->egress ?\n \t\tMLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L3_TUNNEL :\n \t\tMLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L3_TUNNEL_TO_L2;\n-\tres.ft_type = attr->egress ? MLX5DV_FLOW_TABLE_TYPE_NIC_TX :\n-\t\t\t\t     MLX5DV_FLOW_TABLE_TYPE_NIC_RX;\n+\tif (attr->transfer)\n+\t\tres.ft_type = MLX5DV_FLOW_TABLE_TYPE_FDB;\n+\telse\n+\t\tres.ft_type = attr->egress ? MLX5DV_FLOW_TABLE_TYPE_NIC_TX :\n+\t\t\t\t\t     MLX5DV_FLOW_TABLE_TYPE_NIC_RX;\n \tif (flow_dv_encap_decap_resource_register(dev, &res, dev_flow, error))\n \t\treturn rte_flow_error_set(error, EINVAL,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n@@ -1806,11 +1823,14 @@ struct field_modify_info modify_tcp[] = {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct mlx5_ibv_shared *sh = priv->sh;\n \tstruct mlx5_flow_dv_modify_hdr_resource *cache_resource;\n+\tstruct mlx5dv_dr_ns *ns;\n \n-\tstruct mlx5dv_dr_ns *ns =\n-\t\tresource->ft_type == MLX5DV_FLOW_TABLE_TYPE_NIC_TX  ?\n-\t\tsh->tx_ns : sh->rx_ns;\n-\n+\tif (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_FDB)\n+\t\tns = sh->fdb_ns;\n+\telse if (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_NIC_TX)\n+\t\tns = sh->tx_ns;\n+\telse\n+\t\tns = sh->rx_ns;\n \t/* Lookup a matching resource from cache. */\n \tLIST_FOREACH(cache_resource, &sh->modify_cmds, next) {\n \t\tif (resource->ft_type == cache_resource->ft_type &&\n@@ -3604,6 +3624,8 @@ struct field_modify_info modify_tcp[] = {\n \tunion flow_dv_attr flow_attr = { .attr = 0 };\n \tstruct mlx5_flow_dv_tag_resource tag_resource;\n \n+\tif (attr->transfer)\n+\t\tres.ft_type = MLX5DV_FLOW_TABLE_TYPE_FDB;\n \tif (priority == MLX5_FLOW_PRIO_RSVD)\n \t\tpriority = priv->config.flow_prio - 1;\n \tfor (; !actions_end ; actions++) {\n@@ -3709,7 +3731,9 @@ struct field_modify_info modify_tcp[] = {\n \t\tcase RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP:\n \t\tcase RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP:\n \t\t\tif (flow_dv_create_action_l2_encap(dev, actions,\n-\t\t\t\t\t\t\t   dev_flow, error))\n+\t\t\t\t\t\t\t   dev_flow,\n+\t\t\t\t\t\t\t   attr->transfer,\n+\t\t\t\t\t\t\t   error))\n \t\t\t\treturn -rte_errno;\n \t\t\tdev_flow->dv.actions[actions_n++] =\n \t\t\t\tdev_flow->dv.encap_decap->verbs_action;\n@@ -3721,6 +3745,7 @@ struct field_modify_info modify_tcp[] = {\n \t\tcase RTE_FLOW_ACTION_TYPE_VXLAN_DECAP:\n \t\tcase RTE_FLOW_ACTION_TYPE_NVGRE_DECAP:\n \t\t\tif (flow_dv_create_action_l2_decap(dev, dev_flow,\n+\t\t\t\t\t\t\t   attr->transfer,\n \t\t\t\t\t\t\t   error))\n \t\t\t\treturn -rte_errno;\n \t\t\tdev_flow->dv.actions[actions_n++] =\n@@ -3740,9 +3765,9 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\tdev_flow->dv.encap_decap->verbs_action;\n \t\t\t} else {\n \t\t\t\t/* Handle encap without preceding decap. */\n-\t\t\t\tif (flow_dv_create_action_l2_encap(dev, actions,\n-\t\t\t\t\t\t\t\t   dev_flow,\n-\t\t\t\t\t\t\t\t   error))\n+\t\t\t\tif (flow_dv_create_action_l2_encap\n+\t\t\t\t    (dev, actions, dev_flow, attr->transfer,\n+\t\t\t\t     error))\n \t\t\t\t\treturn -rte_errno;\n \t\t\t\tdev_flow->dv.actions[actions_n++] =\n \t\t\t\t\tdev_flow->dv.encap_decap->verbs_action;\n@@ -3757,9 +3782,8 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t}\n \t\t\t/* Handle decap only if it isn't followed by encap. */\n \t\t\tif (action->type != RTE_FLOW_ACTION_TYPE_RAW_ENCAP) {\n-\t\t\t\tif (flow_dv_create_action_l2_decap(dev,\n-\t\t\t\t\t\t\t\t   dev_flow,\n-\t\t\t\t\t\t\t\t   error))\n+\t\t\t\tif (flow_dv_create_action_l2_decap\n+\t\t\t\t    (dev, dev_flow, attr->transfer, error))\n \t\t\t\t\treturn -rte_errno;\n \t\t\t\tdev_flow->dv.actions[actions_n++] =\n \t\t\t\t\tdev_flow->dv.encap_decap->verbs_action;\n",
    "prefixes": [
        "v2",
        "8/9"
    ]
}