get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 65965,
    "url": "http://patches.dpdk.org/api/patches/65965/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1582206824-103222-3-git-send-email-suanmingm@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": "<1582206824-103222-3-git-send-email-suanmingm@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1582206824-103222-3-git-send-email-suanmingm@mellanox.com",
    "date": "2020-02-20T13:53:44",
    "name": "[v3,2/2] net/mlx5: fix lack of match information in meter",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "9994fecb77471018400813b1ce035afdede85c91",
    "submitter": {
        "id": 1358,
        "url": "http://patches.dpdk.org/api/people/1358/?format=api",
        "name": "Suanming Mou",
        "email": "suanmingm@mellanox.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1582206824-103222-3-git-send-email-suanmingm@mellanox.com/mbox/",
    "series": [
        {
            "id": 8634,
            "url": "http://patches.dpdk.org/api/series/8634/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8634",
            "date": "2020-02-20T13:53:42",
            "name": "net/mlx5: copy the item flags from prefix flow",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/8634/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/65965/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/65965/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 507D7A0556;\n\tThu, 20 Feb 2020 14:54:07 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7C79B1BFE3;\n\tThu, 20 Feb 2020 14:53:52 +0100 (CET)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id 0DB541BF98;\n Thu, 20 Feb 2020 14:53:49 +0100 (CET)"
        ],
        "From": "Suanming Mou <suanmingm@mellanox.com>",
        "To": "matan@mellanox.com,\n\tviacheslavo@mellanox.com",
        "Cc": "dev@dpdk.org,\n\trasland@mellanox.com,\n\tstable@dpdk.org",
        "Date": "Thu, 20 Feb 2020 15:53:44 +0200",
        "Message-Id": "<1582206824-103222-3-git-send-email-suanmingm@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1582206824-103222-1-git-send-email-suanmingm@mellanox.com>",
        "References": "<1582122664-54731-1-git-send-email-suanmingm@mellanox.com>\n <1582206824-103222-1-git-send-email-suanmingm@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v3 2/2] net/mlx5: fix lack of match information\n\tin meter",
        "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 <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": "As meter flows are split into three subflows each, the prefix subflow\nwith meter action color the packet, the meter subflow filters out the\ncolored packets, the suffix subflow applies all the remaining actions\nto the passed packets.\n\nCurrently, all the user defined items are matched in the prefix flow.\nFlow id tag match item is the only item added to the meter suffix\nsubflow. Some of the remaining actions to be applied in the suffix\nsubflow require more information in the match item, or the suffix\nsubflow will not be created successfully.\n\nActions require the L3/L4 type in the match items as below:\nRTE_FLOW_ACTION_TYPE_SET_TP_SRC\nRTE_FLOW_ACTION_TYPE_SET_TP_DST\nRTE_FLOW_ACTION_TYPE_DEC_TTL\nRTE_FLOW_ACTION_TYPE_SET_TTL\nRTE_FLOW_ACTION_TYPE_RSS\nRTE_FLOW_ACTION_TYPE_QUEUE\n\nInherit the match item flags from meter prefix subflow to make actions\nin suffix subflow get sufficient information.\n\nFixes: 9ea9b049a960 (\"net/mlx5: split meter flow\")\nCc: stable@dpdk.org\n\nSigned-off-by: Suanming Mou <suanmingm@mellanox.com>\nAcked-by: Matan Azrad <matan@mellanox.com>\n---\n drivers/net/mlx5/mlx5_flow.c    | 11 ++++++---\n drivers/net/mlx5/mlx5_flow_dv.c | 53 ++++++++++++++++++++++++++++++-----------\n 2 files changed, 47 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex 9267858..da60ce7 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -3778,6 +3778,8 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n  *   Pointer to Ethernet device.\n  * @param[in] flow\n  *   Parent flow structure pointer.\n+ * @param[in] prefix_layers\n+ *   Prefix flow layer flags.\n  * @param[in] attr\n  *   Flow rule attributes.\n  * @param[in] items\n@@ -3794,6 +3796,7 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n static int\n flow_create_split_metadata(struct rte_eth_dev *dev,\n \t\t\t   struct rte_flow *flow,\n+\t\t\t   uint64_t prefix_layers,\n \t\t\t   const struct rte_flow_attr *attr,\n \t\t\t   const struct rte_flow_item items[],\n \t\t\t   const struct rte_flow_action actions[],\n@@ -3814,7 +3817,7 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \tif (!config->dv_flow_en ||\n \t    config->dv_xmeta_en == MLX5_XMETA_MODE_LEGACY ||\n \t    !mlx5_flow_ext_mreg_supported(dev))\n-\t\treturn flow_create_split_inner(dev, flow, NULL, 0,\n+\t\treturn flow_create_split_inner(dev, flow, NULL, prefix_layers,\n \t\t\t\t\t       attr, items, actions, external,\n \t\t\t\t\t       error);\n \tactions_n = flow_parse_qrss_action(actions, &qrss);\n@@ -3897,7 +3900,7 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \t\t\tgoto exit;\n \t}\n \t/* Add the unmodified original or prefix subflow. */\n-\tret = flow_create_split_inner(dev, flow, &dev_flow, 0, attr,\n+\tret = flow_create_split_inner(dev, flow, &dev_flow, prefix_layers, attr,\n \t\t\t\t      items, ext_actions ? ext_actions :\n \t\t\t\t      actions, external, error);\n \tif (ret < 0)\n@@ -4092,7 +4095,9 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \t\t\t\t MLX5_FLOW_TABLE_LEVEL_SUFFIX;\n \t}\n \t/* Add the prefix subflow. */\n-\tret = flow_create_split_metadata(dev, flow, &sfx_attr,\n+\tret = flow_create_split_metadata(dev, flow, dev_flow ?\n+\t\t\t\t\t flow_get_prefix_layer_flags(dev_flow) :\n+\t\t\t\t\t 0, &sfx_attr,\n \t\t\t\t\t sfx_items ? sfx_items : items,\n \t\t\t\t\t sfx_actions ? sfx_actions : actions,\n \t\t\t\t\t external, error);\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 19f5b61..ebd7a93 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -85,16 +85,35 @@\n  *   Pointer to item specification.\n  * @param[out] attr\n  *   Pointer to flow attributes structure.\n+ * @param[in] dev_flow\n+ *   Pointer to the sub flow.\n  * @param[in] tunnel_decap\n  *   Whether action is after tunnel decapsulation.\n  */\n static void\n flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr,\n-\t\t  bool tunnel_decap)\n+\t\t  struct mlx5_flow *dev_flow, bool tunnel_decap)\n {\n+\t/*\n+\t * If layers is already initialized, it means this dev_flow is the\n+\t * suffix flow, the layers flags is set by the prefix flow. Need to\n+\t * use the layer flags from prefix flow as the suffix flow may not\n+\t * have the user defined items as the flow is split.\n+\t */\n+\tif (dev_flow->layers) {\n+\t\tif (dev_flow->layers & MLX5_FLOW_LAYER_OUTER_L3_IPV4)\n+\t\t\tattr->ipv4 = 1;\n+\t\telse if (dev_flow->layers & MLX5_FLOW_LAYER_OUTER_L3_IPV6)\n+\t\t\tattr->ipv6 = 1;\n+\t\tif (dev_flow->layers & MLX5_FLOW_LAYER_OUTER_L4_TCP)\n+\t\t\tattr->tcp = 1;\n+\t\telse if (dev_flow->layers & MLX5_FLOW_LAYER_OUTER_L4_UDP)\n+\t\t\tattr->udp = 1;\n+\t\tattr->valid = 1;\n+\t\treturn;\n+\t}\n \tfor (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {\n \t\tuint8_t next_protocol = 0xff;\n-\n \t\tswitch (item->type) {\n \t\tcase RTE_FLOW_ITEM_TYPE_GRE:\n \t\tcase RTE_FLOW_ITEM_TYPE_NVGRE:\n@@ -640,6 +659,8 @@ struct field_modify_info modify_tcp[] = {\n  *   Pointer to rte_flow_item objects list.\n  * @param[in] attr\n  *   Pointer to flow attributes structure.\n+ * @param[in] dev_flow\n+ *   Pointer to the sub flow.\n  * @param[in] tunnel_decap\n  *   Whether action is after tunnel decapsulation.\n  * @param[out] error\n@@ -653,8 +674,8 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t(struct mlx5_flow_dv_modify_hdr_resource *resource,\n \t\t\t const struct rte_flow_action *action,\n \t\t\t const struct rte_flow_item *items,\n-\t\t\t union flow_dv_attr *attr, bool tunnel_decap,\n-\t\t\t struct rte_flow_error *error)\n+\t\t\t union flow_dv_attr *attr, struct mlx5_flow *dev_flow,\n+\t\t\t bool tunnel_decap, struct rte_flow_error *error)\n {\n \tconst struct rte_flow_action_set_tp *conf =\n \t\t(const struct rte_flow_action_set_tp *)(action->conf);\n@@ -666,7 +687,7 @@ struct field_modify_info modify_tcp[] = {\n \tstruct field_modify_info *field;\n \n \tif (!attr->valid)\n-\t\tflow_dv_attr_init(items, attr, tunnel_decap);\n+\t\tflow_dv_attr_init(items, attr, dev_flow, tunnel_decap);\n \tif (attr->udp) {\n \t\tmemset(&udp, 0, sizeof(udp));\n \t\tmemset(&udp_mask, 0, sizeof(udp_mask));\n@@ -716,6 +737,8 @@ struct field_modify_info modify_tcp[] = {\n  *   Pointer to rte_flow_item objects list.\n  * @param[in] attr\n  *   Pointer to flow attributes structure.\n+ * @param[in] dev_flow\n+ *   Pointer to the sub flow.\n  * @param[in] tunnel_decap\n  *   Whether action is after tunnel decapsulation.\n  * @param[out] error\n@@ -729,8 +752,8 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t(struct mlx5_flow_dv_modify_hdr_resource *resource,\n \t\t\t const struct rte_flow_action *action,\n \t\t\t const struct rte_flow_item *items,\n-\t\t\t union flow_dv_attr *attr, bool tunnel_decap,\n-\t\t\t struct rte_flow_error *error)\n+\t\t\t union flow_dv_attr *attr, struct mlx5_flow *dev_flow,\n+\t\t\t bool tunnel_decap, struct rte_flow_error *error)\n {\n \tconst struct rte_flow_action_set_ttl *conf =\n \t\t(const struct rte_flow_action_set_ttl *)(action->conf);\n@@ -742,7 +765,7 @@ struct field_modify_info modify_tcp[] = {\n \tstruct field_modify_info *field;\n \n \tif (!attr->valid)\n-\t\tflow_dv_attr_init(items, attr, tunnel_decap);\n+\t\tflow_dv_attr_init(items, attr, dev_flow, tunnel_decap);\n \tif (attr->ipv4) {\n \t\tmemset(&ipv4, 0, sizeof(ipv4));\n \t\tmemset(&ipv4_mask, 0, sizeof(ipv4_mask));\n@@ -778,6 +801,8 @@ struct field_modify_info modify_tcp[] = {\n  *   Pointer to rte_flow_item objects list.\n  * @param[in] attr\n  *   Pointer to flow attributes structure.\n+ * @param[in] dev_flow\n+ *   Pointer to the sub flow.\n  * @param[in] tunnel_decap\n  *   Whether action is after tunnel decapsulation.\n  * @param[out] error\n@@ -790,8 +815,8 @@ struct field_modify_info modify_tcp[] = {\n flow_dv_convert_action_modify_dec_ttl\n \t\t\t(struct mlx5_flow_dv_modify_hdr_resource *resource,\n \t\t\t const struct rte_flow_item *items,\n-\t\t\t union flow_dv_attr *attr, bool tunnel_decap,\n-\t\t\t struct rte_flow_error *error)\n+\t\t\t union flow_dv_attr *attr, struct mlx5_flow *dev_flow,\n+\t\t\t bool tunnel_decap, struct rte_flow_error *error)\n {\n \tstruct rte_flow_item item;\n \tstruct rte_flow_item_ipv4 ipv4;\n@@ -801,7 +826,7 @@ struct field_modify_info modify_tcp[] = {\n \tstruct field_modify_info *field;\n \n \tif (!attr->valid)\n-\t\tflow_dv_attr_init(items, attr, tunnel_decap);\n+\t\tflow_dv_attr_init(items, attr, dev_flow, tunnel_decap);\n \tif (attr->ipv4) {\n \t\tmemset(&ipv4, 0, sizeof(ipv4));\n \t\tmemset(&ipv4_mask, 0, sizeof(ipv4_mask));\n@@ -7505,7 +7530,7 @@ struct field_modify_info modify_tcp[] = {\n \t\tcase RTE_FLOW_ACTION_TYPE_SET_TP_DST:\n \t\t\tif (flow_dv_convert_action_modify_tp\n \t\t\t\t\t(mhdr_res, actions, items,\n-\t\t\t\t\t &flow_attr, !!(action_flags &\n+\t\t\t\t\t &flow_attr, dev_flow, !!(action_flags &\n \t\t\t\t\t MLX5_FLOW_ACTION_DECAP), error))\n \t\t\t\treturn -rte_errno;\n \t\t\taction_flags |= actions->type ==\n@@ -7515,7 +7540,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_DEC_TTL:\n \t\t\tif (flow_dv_convert_action_modify_dec_ttl\n-\t\t\t\t\t(mhdr_res, items, &flow_attr,\n+\t\t\t\t\t(mhdr_res, items, &flow_attr, dev_flow,\n \t\t\t\t\t !!(action_flags &\n \t\t\t\t\t MLX5_FLOW_ACTION_DECAP), error))\n \t\t\t\treturn -rte_errno;\n@@ -7524,7 +7549,7 @@ struct field_modify_info modify_tcp[] = {\n \t\tcase RTE_FLOW_ACTION_TYPE_SET_TTL:\n \t\t\tif (flow_dv_convert_action_modify_ttl\n \t\t\t\t\t(mhdr_res, actions, items, &flow_attr,\n-\t\t\t\t\t !!(action_flags &\n+\t\t\t\t\t dev_flow, !!(action_flags &\n \t\t\t\t\t MLX5_FLOW_ACTION_DECAP), error))\n \t\t\t\treturn -rte_errno;\n \t\t\taction_flags |= MLX5_FLOW_ACTION_SET_TTL;\n",
    "prefixes": [
        "v3",
        "2/2"
    ]
}