get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 65912,
    "url": "http://patches.dpdk.org/api/patches/65912/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1582122664-54731-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": "<1582122664-54731-3-git-send-email-suanmingm@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1582122664-54731-3-git-send-email-suanmingm@mellanox.com",
    "date": "2020-02-19T14:31:04",
    "name": "[2/2] net/mlx5: fix lack of match information in meter",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5cfc095d4d4903a75691682e05e9cd353aa71a30",
    "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/1582122664-54731-3-git-send-email-suanmingm@mellanox.com/mbox/",
    "series": [
        {
            "id": 8615,
            "url": "http://patches.dpdk.org/api/series/8615/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8615",
            "date": "2020-02-19T14:31:02",
            "name": "net/mlx5: copy the item flags from prefix flow",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/8615/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/65912/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/65912/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 720FBA0555;\n\tWed, 19 Feb 2020 15:31:38 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BCD1F1BFAA;\n\tWed, 19 Feb 2020 15:31:15 +0100 (CET)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id 355CF1BF95;\n Wed, 19 Feb 2020 15:31:11 +0100 (CET)"
        ],
        "From": "Suanming Mou <suanmingm@mellanox.com>",
        "To": "viacheslavo@mellanox.com,\n\tmatan@mellanox.com",
        "Cc": "dev@dpdk.org,\n\trasland@mellanox.com,\n\tstable@dpdk.org",
        "Date": "Wed, 19 Feb 2020 16:31:04 +0200",
        "Message-Id": "<1582122664-54731-3-git-send-email-suanmingm@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1582122664-54731-1-git-send-email-suanmingm@mellanox.com>",
        "References": "<1582122664-54731-1-git-send-email-suanmingm@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 2/2] net/mlx5: fix lack of match information in\n\tmeter",
        "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>\n---\n drivers/net/mlx5/mlx5_flow.c    | 22 +++++++++++----\n drivers/net/mlx5/mlx5_flow_dv.c | 62 +++++++++++++++++++++++++++++++----------\n 2 files changed, 65 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex 2f57759..f533f78 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -3440,8 +3440,18 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \tdev_flow->external = external;\n \t/* Subflow object was created, we must include one in the list. */\n \tLIST_INSERT_HEAD(&flow->dev_flows, dev_flow, next);\n-\tif (prefix_flow)\n+\tif (prefix_flow) {\n+\t\t/*\n+\t\t * Some suffix subflow need the item flags and decap action\n+\t\t * flag to know if actions in suffix flow should be applied\n+\t\t * to new outer layer or not.\n+\t\t * Action flag will be overwritten in tanslate after using.\n+\t\t * No need to copy the hash_fields, as it will be generated\n+\t\t * by RSS action with the item layer flags.\n+\t\t */\n \t\tdev_flow->layers = prefix_flow->layers;\n+\t\tdev_flow->actions = prefix_flow->actions;\n+\t}\n \tif (sub_flow)\n \t\t*sub_flow = dev_flow;\n \treturn flow_drv_translate(dev, dev_flow, attr, items, actions, error);\n@@ -3737,6 +3747,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_flow\n+ *   Prefix flow structure pointer.\n  * @param[in] attr\n  *   Flow rule attributes.\n  * @param[in] items\n@@ -3753,6 +3765,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   struct mlx5_flow *prefix_flow,\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@@ -3773,7 +3786,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, NULL,\n+\t\treturn flow_create_split_inner(dev, flow, NULL, prefix_flow,\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@@ -3856,7 +3869,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, NULL, attr,\n+\tret = flow_create_split_inner(dev, flow, &dev_flow, prefix_flow, attr,\n \t\t\t\t      items, ext_actions ? ext_actions :\n \t\t\t\t      actions, external, error);\n \tif (ret < 0)\n@@ -3892,7 +3905,6 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \t\t\t\t.type = RTE_FLOW_ACTION_TYPE_END,\n \t\t\t},\n \t\t};\n-\t\tstruct mlx5_flow *prefix_flow;\n \n \t\t/*\n \t\t * Configure the tag item only if there is no meter subflow.\n@@ -4052,7 +4064,7 @@ 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, &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 c958fca..359a037 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -85,16 +85,44 @@\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+\tif (dev_flow->layers) {\n+\t\tif (dev_flow->actions & MLX5_FLOW_ACTION_DECAP) {\n+\t\t\tif (dev_flow->layers & MLX5_FLOW_LAYER_INNER_L3_IPV4)\n+\t\t\t\tattr->ipv4 = 1;\n+\t\t\telse if (dev_flow->layers &\n+\t\t\t\t MLX5_FLOW_LAYER_INNER_L3_IPV6)\n+\t\t\t\tattr->ipv6 = 1;\n+\t\t\tif (dev_flow->layers & MLX5_FLOW_LAYER_INNER_L4_TCP)\n+\t\t\t\tattr->tcp = 1;\n+\t\t\telse if (dev_flow->layers &\n+\t\t\t\t MLX5_FLOW_LAYER_INNER_L4_UDP)\n+\t\t\t\tattr->udp = 1;\n+\t\t} else {\n+\t\t\tif (dev_flow->layers & MLX5_FLOW_LAYER_OUTER_L3_IPV4)\n+\t\t\t\tattr->ipv4 = 1;\n+\t\t\telse if (dev_flow->layers &\n+\t\t\t\t MLX5_FLOW_LAYER_OUTER_L3_IPV6)\n+\t\t\t\tattr->ipv6 = 1;\n+\t\t\tif (dev_flow->layers & MLX5_FLOW_LAYER_OUTER_L4_TCP)\n+\t\t\t\tattr->tcp = 1;\n+\t\t\telse if (dev_flow->layers &\n+\t\t\t\t MLX5_FLOW_LAYER_OUTER_L4_UDP)\n+\t\t\t\tattr->udp = 1;\n+\t\t}\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 +668,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 +683,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 +696,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 +746,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 +761,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 +774,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 +810,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 +824,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 +835,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 +7539,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 +7549,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 +7558,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": [
        "2/2"
    ]
}