get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96599,
    "url": "https://patches.dpdk.org/api/patches/96599/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210803083817.1243796-22-wenjun1.wu@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20210803083817.1243796-22-wenjun1.wu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210803083817.1243796-22-wenjun1.wu@intel.com",
    "date": "2021-08-03T08:38:16",
    "name": "[21/22] net/ice: support flow priority for DCF switch filter",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "840a1c30a20a831940f21f3c7dc86946ca5397e6",
    "submitter": {
        "id": 2083,
        "url": "https://patches.dpdk.org/api/people/2083/?format=api",
        "name": "Wenjun Wu",
        "email": "wenjun1.wu@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210803083817.1243796-22-wenjun1.wu@intel.com/mbox/",
    "series": [
        {
            "id": 18158,
            "url": "https://patches.dpdk.org/api/series/18158/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=18158",
            "date": "2021-08-03T08:37:55",
            "name": "backport feature support to DPDK 20.11",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/18158/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/96599/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/96599/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id A16FCA0C41;\n\tTue,  3 Aug 2021 10:59:13 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C56D94122A;\n\tTue,  3 Aug 2021 10:57:36 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id 8DFBD411DB\n for <dev@dpdk.org>; Tue,  3 Aug 2021 10:57:17 +0200 (CEST)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 03 Aug 2021 01:57:16 -0700",
            "from wuwenjun.sh.intel.com ([10.67.110.197])\n by fmsmga008.fm.intel.com with ESMTP; 03 Aug 2021 01:57:14 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10064\"; a=\"211764427\"",
            "E=Sophos;i=\"5.84,291,1620716400\"; d=\"scan'208\";a=\"211764427\"",
            "E=Sophos;i=\"5.84,291,1620716400\"; d=\"scan'208\";a=\"479396691\""
        ],
        "X-ExtLoop1": "1",
        "From": "Wenjun Wu <wenjun1.wu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue,  3 Aug 2021 16:38:16 +0800",
        "Message-Id": "<20210803083817.1243796-22-wenjun1.wu@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210803083817.1243796-1-wenjun1.wu@intel.com>",
        "References": "<20210803083817.1243796-1-wenjun1.wu@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 21/22] net/ice: support flow priority for DCF\n switch filter",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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": "From: Yuying Zhang <yuying.zhang@intel.com>\n\n[ upstream commit 2321e34c23b386c46e4a644682e40214cf59ee4f ]\n\nThis patch is not for LTS upstream, just for customer to cherry-pick.\n\nSupport rte flow priority attribute for DCF switch filter.\nWhen a packet is matched by two rules, the behavior of it\nis not defined. This patch supports flow priority to create\ndifferent recipes for this situation. Only priority 0 and 1\nare supported and higher value denotes higher priority.\n\nfor example:\n1. flow create 0 priority 0 ingress pattern eth / vlan tci is 2 / vlan\n   tci is 2 / end actions vf id 2 / end\n2. flow create 0 priority 1 ingress pattern eth / vlan / vlan / ipv4 dst\n   is 192.168.0.1 / end actions vf id 1 / end\n\nThese two rules can be created at the same time in DCF switch\nfilter and priority of rule 2 is higher. Packet hits rule 2\nwhen two conditions of rules are satisfied.\n\nSigned-off-by: Yuying Zhang <yuying.zhang@intel.com>\nAcked-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/ice/ice_acl_filter.c    |  1 +\n drivers/net/ice/ice_fdir_filter.c   |  1 +\n drivers/net/ice/ice_generic_flow.c  | 18 ++++++++++--------\n drivers/net/ice/ice_generic_flow.h  |  1 +\n drivers/net/ice/ice_hash.c          |  2 ++\n drivers/net/ice/ice_switch_filter.c | 14 +++++++++-----\n 6 files changed, 24 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_acl_filter.c b/drivers/net/ice/ice_acl_filter.c\nindex f7dbe53574..14e36aa9f6 100644\n--- a/drivers/net/ice/ice_acl_filter.c\n+++ b/drivers/net/ice/ice_acl_filter.c\n@@ -904,6 +904,7 @@ ice_acl_parse(struct ice_adapter *ad,\n \t       uint32_t array_len,\n \t       const struct rte_flow_item pattern[],\n \t       const struct rte_flow_action actions[],\n+\t       uint32_t priority __rte_unused,\n \t       void **meta,\n \t       struct rte_flow_error *error)\n {\ndiff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c\nindex 4a071254ce..d2bc882720 100644\n--- a/drivers/net/ice/ice_fdir_filter.c\n+++ b/drivers/net/ice/ice_fdir_filter.c\n@@ -2029,6 +2029,7 @@ ice_fdir_parse(struct ice_adapter *ad,\n \t       uint32_t array_len,\n \t       const struct rte_flow_item pattern[],\n \t       const struct rte_flow_action actions[],\n+\t       uint32_t priority __rte_unused,\n \t       void **meta,\n \t       struct rte_flow_error *error)\n {\ndiff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c\nindex c9910a65d1..ec141e8fa0 100644\n--- a/drivers/net/ice/ice_generic_flow.c\n+++ b/drivers/net/ice/ice_generic_flow.c\n@@ -1799,6 +1799,7 @@ enum rte_flow_item_type pattern_eth_ipv6_pfcp[] = {\n typedef struct ice_flow_engine * (*parse_engine_t)(struct ice_adapter *ad,\n \t\tstruct rte_flow *flow,\n \t\tstruct ice_parser_list *parser_list,\n+\t\tuint32_t priority,\n \t\tconst struct rte_flow_item pattern[],\n \t\tconst struct rte_flow_action actions[],\n \t\tstruct rte_flow_error *error);\n@@ -1990,11 +1991,10 @@ ice_flow_valid_attr(struct ice_adapter *ad,\n \t} else {\n \t\t*ice_pipeline_stage =\n \t\t\tICE_FLOW_CLASSIFY_STAGE_DISTRIBUTOR_ONLY;\n-\t\t/* Not supported */\n-\t\tif (attr->priority) {\n+\t\tif (attr->priority > 1) {\n \t\t\trte_flow_error_set(error, EINVAL,\n \t\t\t\t\tRTE_FLOW_ERROR_TYPE_ATTR_PRIORITY,\n-\t\t\t\t\tattr, \"Not support priority.\");\n+\t\t\t\t\tattr, \"Only support priority 0 and 1.\");\n \t\t\treturn -rte_errno;\n \t\t}\n \t}\n@@ -2139,6 +2139,7 @@ static struct ice_flow_engine *\n ice_parse_engine_create(struct ice_adapter *ad,\n \t\tstruct rte_flow *flow,\n \t\tstruct ice_parser_list *parser_list,\n+\t\tuint32_t priority,\n \t\tconst struct rte_flow_item pattern[],\n \t\tconst struct rte_flow_action actions[],\n \t\tstruct rte_flow_error *error)\n@@ -2154,7 +2155,7 @@ ice_parse_engine_create(struct ice_adapter *ad,\n \t\tif (parser_node->parser->parse_pattern_action(ad,\n \t\t\t\tparser_node->parser->array,\n \t\t\t\tparser_node->parser->array_len,\n-\t\t\t\tpattern, actions, &meta, error) < 0)\n+\t\t\t\tpattern, actions, priority, &meta, error) < 0)\n \t\t\tcontinue;\n \n \t\tengine = parser_node->parser->engine;\n@@ -2172,6 +2173,7 @@ static struct ice_flow_engine *\n ice_parse_engine_validate(struct ice_adapter *ad,\n \t\tstruct rte_flow *flow __rte_unused,\n \t\tstruct ice_parser_list *parser_list,\n+\t\tuint32_t priority,\n \t\tconst struct rte_flow_item pattern[],\n \t\tconst struct rte_flow_action actions[],\n \t\tstruct rte_flow_error *error)\n@@ -2184,7 +2186,7 @@ ice_parse_engine_validate(struct ice_adapter *ad,\n \t\tif (parser_node->parser->parse_pattern_action(ad,\n \t\t\t\tparser_node->parser->array,\n \t\t\t\tparser_node->parser->array_len,\n-\t\t\t\tpattern, actions, NULL, error) < 0)\n+\t\t\t\tpattern, actions, priority, NULL, error) < 0)\n \t\t\tcontinue;\n \n \t\tengine = parser_node->parser->engine;\n@@ -2234,7 +2236,7 @@ ice_flow_process_filter(struct rte_eth_dev *dev,\n \t\treturn ret;\n \n \t*engine = ice_parse_engine(ad, flow, &pf->rss_parser_list,\n-\t\t\tpattern, actions, error);\n+\t\t\tattr->priority, pattern, actions, error);\n \tif (*engine != NULL)\n \t\treturn 0;\n \n@@ -2242,11 +2244,11 @@ ice_flow_process_filter(struct rte_eth_dev *dev,\n \tcase ICE_FLOW_CLASSIFY_STAGE_DISTRIBUTOR_ONLY:\n \tcase ICE_FLOW_CLASSIFY_STAGE_DISTRIBUTOR:\n \t\t*engine = ice_parse_engine(ad, flow, &pf->dist_parser_list,\n-\t\t\t\tpattern, actions, error);\n+\t\t\t\tattr->priority, pattern, actions, error);\n \t\tbreak;\n \tcase ICE_FLOW_CLASSIFY_STAGE_PERMISSION:\n \t\t*engine = ice_parse_engine(ad, flow, &pf->perm_parser_list,\n-\t\t\t\tpattern, actions, error);\n+\t\t\t\tattr->priority, pattern, actions, error);\n \t\tbreak;\n \tdefault:\n \t\treturn -EINVAL;\ndiff --git a/drivers/net/ice/ice_generic_flow.h b/drivers/net/ice/ice_generic_flow.h\nindex 1b2cdf7e4c..6bfe3f6dd6 100644\n--- a/drivers/net/ice/ice_generic_flow.h\n+++ b/drivers/net/ice/ice_generic_flow.h\n@@ -555,6 +555,7 @@ typedef int (*parse_pattern_action_t)(struct ice_adapter *ad,\n \t\tuint32_t array_len,\n \t\tconst struct rte_flow_item pattern[],\n \t\tconst struct rte_flow_action actions[],\n+\t\tuint32_t priority,\n \t\tvoid **meta,\n \t\tstruct rte_flow_error *error);\n \ndiff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c\nindex 2b0a479c7e..ae095eb3cf 100644\n--- a/drivers/net/ice/ice_hash.c\n+++ b/drivers/net/ice/ice_hash.c\n@@ -75,6 +75,7 @@ ice_hash_parse_pattern_action(struct ice_adapter *ad,\n \t\t\tuint32_t array_len,\n \t\t\tconst struct rte_flow_item pattern[],\n \t\t\tconst struct rte_flow_action actions[],\n+\t\t\tuint32_t priority,\n \t\t\tvoid **meta,\n \t\t\tstruct rte_flow_error *error);\n \n@@ -1237,6 +1238,7 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad,\n \t\t\tuint32_t array_len,\n \t\t\tconst struct rte_flow_item pattern[],\n \t\t\tconst struct rte_flow_action actions[],\n+\t\t\tuint32_t priority __rte_unused,\n \t\t\tvoid **meta,\n \t\t\tstruct rte_flow_error *error)\n {\ndiff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c\nindex 455123ee06..48726dc967 100644\n--- a/drivers/net/ice/ice_switch_filter.c\n+++ b/drivers/net/ice/ice_switch_filter.c\n@@ -1512,6 +1512,7 @@ ice_switch_inset_get(const struct rte_flow_item pattern[],\n static int\n ice_switch_parse_dcf_action(struct ice_dcf_adapter *ad,\n \t\t\t    const struct rte_flow_action *actions,\n+\t\t\t    uint32_t priority,\n \t\t\t    struct rte_flow_error *error,\n \t\t\t    struct ice_adv_rule_info *rule_info)\n {\n@@ -1559,7 +1560,7 @@ ice_switch_parse_dcf_action(struct ice_dcf_adapter *ad,\n \trule_info->sw_act.src = rule_info->sw_act.vsi_handle;\n \trule_info->sw_act.flag = ICE_FLTR_RX;\n \trule_info->rx = 1;\n-\trule_info->priority = 5;\n+\trule_info->priority = priority + 5;\n \n \treturn 0;\n }\n@@ -1567,6 +1568,7 @@ ice_switch_parse_dcf_action(struct ice_dcf_adapter *ad,\n static int\n ice_switch_parse_action(struct ice_pf *pf,\n \t\tconst struct rte_flow_action *actions,\n+\t\tuint32_t priority,\n \t\tstruct rte_flow_error *error,\n \t\tstruct ice_adv_rule_info *rule_info)\n {\n@@ -1637,7 +1639,7 @@ ice_switch_parse_action(struct ice_pf *pf,\n \trule_info->sw_act.vsi_handle = vsi->idx;\n \trule_info->rx = 1;\n \trule_info->sw_act.src = vsi->idx;\n-\trule_info->priority = 5;\n+\trule_info->priority = priority + 5;\n \n \treturn 0;\n \n@@ -1729,6 +1731,7 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad,\n \t\tuint32_t array_len,\n \t\tconst struct rte_flow_item pattern[],\n \t\tconst struct rte_flow_action actions[],\n+\t\tuint32_t priority,\n \t\tvoid **meta,\n \t\tstruct rte_flow_error *error)\n {\n@@ -1818,10 +1821,11 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad,\n \t\tgoto error;\n \n \tif (ad->hw.dcf_enabled)\n-\t\tret = ice_switch_parse_dcf_action((void *)ad, actions, error,\n-\t\t\t\t\t\t  &rule_info);\n+\t\tret = ice_switch_parse_dcf_action((void *)ad, actions, priority,\n+\t\t\t\t\t\t  error, &rule_info);\n \telse\n-\t\tret = ice_switch_parse_action(pf, actions, error, &rule_info);\n+\t\tret = ice_switch_parse_action(pf, actions, priority, error,\n+\t\t\t\t\t      &rule_info);\n \n \tif (ret)\n \t\tgoto error;\n",
    "prefixes": [
        "21/22"
    ]
}