get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87130,
    "url": "https://patches.dpdk.org/api/patches/87130/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210122191925.24308-20-lironh@marvell.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": "<20210122191925.24308-20-lironh@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210122191925.24308-20-lironh@marvell.com",
    "date": "2021-01-22T19:19:07",
    "name": "[v2,19/37] net/mvpp2: flow: support generic pattern combinations",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "aa860757bcc98837650c5a2fccbd598a6d2dd0b4",
    "submitter": {
        "id": 996,
        "url": "https://patches.dpdk.org/api/people/996/?format=api",
        "name": "Liron Himi",
        "email": "lironh@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210122191925.24308-20-lironh@marvell.com/mbox/",
    "series": [
        {
            "id": 14911,
            "url": "https://patches.dpdk.org/api/series/14911/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14911",
            "date": "2021-01-22T19:18:48",
            "name": "net/mvpp2: misc updates",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/14911/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/87130/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/87130/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 34A7EA0A0A;\n\tFri, 22 Jan 2021 20:22:21 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 372FC141110;\n\tFri, 22 Jan 2021 20:20:29 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 51225141110\n for <dev@dpdk.org>; Fri, 22 Jan 2021 20:20:27 +0100 (CET)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id\n 10MJB4ik016361 for <dev@dpdk.org>; Fri, 22 Jan 2021 11:20:26 -0800",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com with ESMTP id 3668p7tpff-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Fri, 22 Jan 2021 11:20:26 -0800",
            "from SC-EXCH03.marvell.com (10.93.176.83) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Fri, 22 Jan 2021 11:20:24 -0800",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH03.marvell.com\n (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Fri, 22 Jan 2021 11:20:23 -0800",
            "from pt-lxl0023.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Fri, 22 Jan 2021 11:20:22 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=caI1H23mxEf2yg3Di9YyVaZxNeuGmEDXHqGu4L2cV9w=;\n b=i1I+1Y/RZAVeyeyySilbl/cmA1XwkQ7mjWxS2Hpn4TPTFhYV3nnbroZ/e8VV82lspFwK\n y+Fx1xWihQAoDRPzvk7muxrquX5JtjetKKmNnMffk7ydogBI2udtMQPZGUoJTmXrMEa0\n diwJdCdWj21pnjoUjdrsFmpnIOTgXjR4DJfksfc0/0ObD4fXL5qPXzPltiYRCTUKXN1W\n Ng7tMmyffFV59Lg5arYjwVEwIDyBQSx6YWy15TdUW6ahJpr+O0k0LEte++Q+nnSPX5DU\n xnMA4/2RHtYpwbmMzf0rhKXMtv+t+v8vs1W3oDLOVcCFo0f3hznVm3uhEEkR0G6MUh2k HA==",
        "From": "<lironh@marvell.com>",
        "To": "<jerinj@marvell.com>",
        "CC": "<dev@dpdk.org>, Liron Himi <lironh@marvell.com>",
        "Date": "Fri, 22 Jan 2021 21:19:07 +0200",
        "Message-ID": "<20210122191925.24308-20-lironh@marvell.com>",
        "X-Mailer": "git-send-email 2.28.0",
        "In-Reply-To": "<20210122191925.24308-1-lironh@marvell.com>",
        "References": "<20201202101212.4717-1-lironh@marvell.com>\n <20210122191925.24308-1-lironh@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737\n definitions=2021-01-22_14:2021-01-22,\n 2021-01-22 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v2 19/37] net/mvpp2: flow: support generic\n pattern combinations",
        "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: Liron Himi <lironh@marvell.com>\n\nCurrently only specific pattern combinations are supported.\nthis makes it hard to support additional pattern.\nin addition there is no a real limitation that prevent any combination.\nThis patch iterate the input patterns and convert them to a mvpp2 API.\n\nThe doc doesn't describes those limitation so\njust update the action list\n\nSigned-off-by: Liron Himi <lironh@marvell.com>\n---\n doc/guides/nics/mvpp2.rst     |    1 +\n drivers/net/mvpp2/mrvl_flow.c | 1254 +++++----------------------------\n 2 files changed, 159 insertions(+), 1096 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/mvpp2.rst b/doc/guides/nics/mvpp2.rst\nindex 6fbce8358..8cea0097b 100644\n--- a/doc/guides/nics/mvpp2.rst\n+++ b/doc/guides/nics/mvpp2.rst\n@@ -368,6 +368,7 @@ Following flow action items are supported by the driver:\n \n * DROP\n * QUEUE\n+* METER\n \n Supported flow items\n ~~~~~~~~~~~~~~~~~~~~\ndiff --git a/drivers/net/mvpp2/mrvl_flow.c b/drivers/net/mvpp2/mrvl_flow.c\nindex ea4325528..a1a748529 100644\n--- a/drivers/net/mvpp2/mrvl_flow.c\n+++ b/drivers/net/mvpp2/mrvl_flow.c\n@@ -20,185 +20,12 @@\n /** Size of the classifier key and mask strings. */\n #define MRVL_CLS_STR_SIZE_MAX 40\n \n-static const enum rte_flow_item_type pattern_eth[] = {\n-\tRTE_FLOW_ITEM_TYPE_ETH,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_eth_vlan[] = {\n-\tRTE_FLOW_ITEM_TYPE_ETH,\n-\tRTE_FLOW_ITEM_TYPE_VLAN,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_eth_vlan_ip[] = {\n-\tRTE_FLOW_ITEM_TYPE_ETH,\n-\tRTE_FLOW_ITEM_TYPE_VLAN,\n-\tRTE_FLOW_ITEM_TYPE_IPV4,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_eth_vlan_ip6[] = {\n-\tRTE_FLOW_ITEM_TYPE_ETH,\n-\tRTE_FLOW_ITEM_TYPE_VLAN,\n-\tRTE_FLOW_ITEM_TYPE_IPV6,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_eth_ip4[] = {\n-\tRTE_FLOW_ITEM_TYPE_ETH,\n-\tRTE_FLOW_ITEM_TYPE_IPV4,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_eth_ip4_tcp[] = {\n-\tRTE_FLOW_ITEM_TYPE_ETH,\n-\tRTE_FLOW_ITEM_TYPE_IPV4,\n-\tRTE_FLOW_ITEM_TYPE_TCP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_eth_ip4_udp[] = {\n-\tRTE_FLOW_ITEM_TYPE_ETH,\n-\tRTE_FLOW_ITEM_TYPE_IPV4,\n-\tRTE_FLOW_ITEM_TYPE_UDP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_eth_ip6[] = {\n-\tRTE_FLOW_ITEM_TYPE_ETH,\n-\tRTE_FLOW_ITEM_TYPE_IPV6,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_eth_ip6_tcp[] = {\n-\tRTE_FLOW_ITEM_TYPE_ETH,\n-\tRTE_FLOW_ITEM_TYPE_IPV6,\n-\tRTE_FLOW_ITEM_TYPE_TCP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_eth_ip6_udp[] = {\n-\tRTE_FLOW_ITEM_TYPE_ETH,\n-\tRTE_FLOW_ITEM_TYPE_IPV6,\n-\tRTE_FLOW_ITEM_TYPE_UDP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_vlan[] = {\n-\tRTE_FLOW_ITEM_TYPE_VLAN,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_vlan_ip[] = {\n-\tRTE_FLOW_ITEM_TYPE_VLAN,\n-\tRTE_FLOW_ITEM_TYPE_IPV4,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_vlan_ip_tcp[] = {\n-\tRTE_FLOW_ITEM_TYPE_VLAN,\n-\tRTE_FLOW_ITEM_TYPE_IPV4,\n-\tRTE_FLOW_ITEM_TYPE_TCP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_vlan_ip_udp[] = {\n-\tRTE_FLOW_ITEM_TYPE_VLAN,\n-\tRTE_FLOW_ITEM_TYPE_IPV4,\n-\tRTE_FLOW_ITEM_TYPE_UDP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_vlan_ip6[] = {\n-\tRTE_FLOW_ITEM_TYPE_VLAN,\n-\tRTE_FLOW_ITEM_TYPE_IPV6,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_vlan_ip6_tcp[] = {\n-\tRTE_FLOW_ITEM_TYPE_VLAN,\n-\tRTE_FLOW_ITEM_TYPE_IPV6,\n-\tRTE_FLOW_ITEM_TYPE_TCP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_vlan_ip6_udp[] = {\n-\tRTE_FLOW_ITEM_TYPE_VLAN,\n-\tRTE_FLOW_ITEM_TYPE_IPV6,\n-\tRTE_FLOW_ITEM_TYPE_UDP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_ip[] = {\n-\tRTE_FLOW_ITEM_TYPE_IPV4,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_ip6[] = {\n-\tRTE_FLOW_ITEM_TYPE_IPV6,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_ip_tcp[] = {\n-\tRTE_FLOW_ITEM_TYPE_IPV4,\n-\tRTE_FLOW_ITEM_TYPE_TCP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_ip6_tcp[] = {\n-\tRTE_FLOW_ITEM_TYPE_IPV6,\n-\tRTE_FLOW_ITEM_TYPE_TCP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_ip_udp[] = {\n-\tRTE_FLOW_ITEM_TYPE_IPV4,\n-\tRTE_FLOW_ITEM_TYPE_UDP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_ip6_udp[] = {\n-\tRTE_FLOW_ITEM_TYPE_IPV6,\n-\tRTE_FLOW_ITEM_TYPE_UDP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_tcp[] = {\n-\tRTE_FLOW_ITEM_TYPE_TCP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n-static const enum rte_flow_item_type pattern_udp[] = {\n-\tRTE_FLOW_ITEM_TYPE_UDP,\n-\tRTE_FLOW_ITEM_TYPE_END\n-};\n-\n #define MRVL_VLAN_ID_MASK 0x0fff\n #define MRVL_VLAN_PRI_MASK 0x7000\n #define MRVL_IPV4_DSCP_MASK 0xfc\n #define MRVL_IPV4_ADDR_MASK 0xffffffff\n #define MRVL_IPV6_FLOW_MASK 0x0fffff\n \n-/**\n- * Given a flow item, return the next non-void one.\n- *\n- * @param items Pointer to the item in the table.\n- * @returns Next not-void item, NULL otherwise.\n- */\n-static const struct rte_flow_item *\n-mrvl_next_item(const struct rte_flow_item *items)\n-{\n-\tconst struct rte_flow_item *item = items;\n-\n-\tfor (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {\n-\t\tif (item->type != RTE_FLOW_ITEM_TYPE_VOID)\n-\t\t\treturn item;\n-\t}\n-\n-\treturn NULL;\n-}\n-\n /**\n  * Allocate memory for classifier rule key and mask fields.\n  *\n@@ -361,9 +188,6 @@ mrvl_parse_mac(const struct rte_flow_item_eth *spec,\n \tstruct pp2_cls_rule_key_field *key_field;\n \tconst uint8_t *k, *m;\n \n-\tif (flow->rule.num_fields >= PP2_CLS_TBL_MAX_NUM_FIELDS)\n-\t\treturn -ENOSPC;\n-\n \tif (parse_dst) {\n \t\tk = spec->dst.addr_bytes;\n \t\tm = mask->dst.addr_bytes;\n@@ -441,9 +265,6 @@ mrvl_parse_type(const struct rte_flow_item_eth *spec,\n \tstruct pp2_cls_rule_key_field *key_field;\n \tuint16_t k;\n \n-\tif (flow->rule.num_fields >= PP2_CLS_TBL_MAX_NUM_FIELDS)\n-\t\treturn -ENOSPC;\n-\n \tkey_field = &flow->rule.fields[flow->rule.num_fields];\n \tmrvl_alloc_key_mask(key_field);\n \tkey_field->size = 2;\n@@ -475,9 +296,6 @@ mrvl_parse_vlan_id(const struct rte_flow_item_vlan *spec,\n \tstruct pp2_cls_rule_key_field *key_field;\n \tuint16_t k;\n \n-\tif (flow->rule.num_fields >= PP2_CLS_TBL_MAX_NUM_FIELDS)\n-\t\treturn -ENOSPC;\n-\n \tkey_field = &flow->rule.fields[flow->rule.num_fields];\n \tmrvl_alloc_key_mask(key_field);\n \tkey_field->size = 2;\n@@ -509,9 +327,6 @@ mrvl_parse_vlan_pri(const struct rte_flow_item_vlan *spec,\n \tstruct pp2_cls_rule_key_field *key_field;\n \tuint16_t k;\n \n-\tif (flow->rule.num_fields >= PP2_CLS_TBL_MAX_NUM_FIELDS)\n-\t\treturn -ENOSPC;\n-\n \tkey_field = &flow->rule.fields[flow->rule.num_fields];\n \tmrvl_alloc_key_mask(key_field);\n \tkey_field->size = 1;\n@@ -543,9 +358,6 @@ mrvl_parse_ip4_dscp(const struct rte_flow_item_ipv4 *spec,\n \tstruct pp2_cls_rule_key_field *key_field;\n \tuint8_t k, m;\n \n-\tif (flow->rule.num_fields >= PP2_CLS_TBL_MAX_NUM_FIELDS)\n-\t\treturn -ENOSPC;\n-\n \tkey_field = &flow->rule.fields[flow->rule.num_fields];\n \tmrvl_alloc_key_mask(key_field);\n \tkey_field->size = 1;\n@@ -582,9 +394,6 @@ mrvl_parse_ip4_addr(const struct rte_flow_item_ipv4 *spec,\n \tstruct in_addr k;\n \tuint32_t m;\n \n-\tif (flow->rule.num_fields >= PP2_CLS_TBL_MAX_NUM_FIELDS)\n-\t\treturn -ENOSPC;\n-\n \tmemset(&k, 0, sizeof(k));\n \tif (parse_dst) {\n \t\tk.s_addr = spec->hdr.dst_addr;\n@@ -660,9 +469,6 @@ mrvl_parse_ip4_proto(const struct rte_flow_item_ipv4 *spec,\n \tstruct pp2_cls_rule_key_field *key_field;\n \tuint8_t k = spec->hdr.next_proto_id;\n \n-\tif (flow->rule.num_fields >= PP2_CLS_TBL_MAX_NUM_FIELDS)\n-\t\treturn -ENOSPC;\n-\n \tkey_field = &flow->rule.fields[flow->rule.num_fields];\n \tmrvl_alloc_key_mask(key_field);\n \tkey_field->size = 1;\n@@ -696,9 +502,6 @@ mrvl_parse_ip6_addr(const struct rte_flow_item_ipv6 *spec,\n \tint size = sizeof(spec->hdr.dst_addr);\n \tstruct in6_addr k, m;\n \n-\tif (flow->rule.num_fields >= PP2_CLS_TBL_MAX_NUM_FIELDS)\n-\t\treturn -ENOSPC;\n-\n \tmemset(&k, 0, sizeof(k));\n \tif (parse_dst) {\n \t\tmemcpy(k.s6_addr, spec->hdr.dst_addr, size);\n@@ -775,9 +578,6 @@ mrvl_parse_ip6_flow(const struct rte_flow_item_ipv6 *spec,\n \tuint32_t k = rte_be_to_cpu_32(spec->hdr.vtc_flow) & MRVL_IPV6_FLOW_MASK,\n \t\t m = rte_be_to_cpu_32(mask->hdr.vtc_flow) & MRVL_IPV6_FLOW_MASK;\n \n-\tif (flow->rule.num_fields >= PP2_CLS_TBL_MAX_NUM_FIELDS)\n-\t\treturn -ENOSPC;\n-\n \tkey_field = &flow->rule.fields[flow->rule.num_fields];\n \tmrvl_alloc_key_mask(key_field);\n \tkey_field->size = 3;\n@@ -809,9 +609,6 @@ mrvl_parse_ip6_next_hdr(const struct rte_flow_item_ipv6 *spec,\n \tstruct pp2_cls_rule_key_field *key_field;\n \tuint8_t k = spec->hdr.proto;\n \n-\tif (flow->rule.num_fields >= PP2_CLS_TBL_MAX_NUM_FIELDS)\n-\t\treturn -ENOSPC;\n-\n \tkey_field = &flow->rule.fields[flow->rule.num_fields];\n \tmrvl_alloc_key_mask(key_field);\n \tkey_field->size = 1;\n@@ -844,9 +641,6 @@ mrvl_parse_tcp_port(const struct rte_flow_item_tcp *spec,\n \tstruct pp2_cls_rule_key_field *key_field;\n \tuint16_t k;\n \n-\tif (flow->rule.num_fields >= PP2_CLS_TBL_MAX_NUM_FIELDS)\n-\t\treturn -ENOSPC;\n-\n \tkey_field = &flow->rule.fields[flow->rule.num_fields];\n \tmrvl_alloc_key_mask(key_field);\n \tkey_field->size = 2;\n@@ -920,9 +714,6 @@ mrvl_parse_udp_port(const struct rte_flow_item_udp *spec,\n \tstruct pp2_cls_rule_key_field *key_field;\n \tuint16_t k;\n \n-\tif (flow->rule.num_fields >= PP2_CLS_TBL_MAX_NUM_FIELDS)\n-\t\treturn -ENOSPC;\n-\n \tkey_field = &flow->rule.fields[flow->rule.num_fields];\n \tmrvl_alloc_key_mask(key_field);\n \tkey_field->size = 2;\n@@ -1243,8 +1034,8 @@ mrvl_parse_tcp(const struct rte_flow_item *item,\n \tint ret;\n \n \tret = mrvl_parse_init(item, (const void **)&spec, (const void **)&mask,\n-\t\t\t      &rte_flow_item_ipv4_mask,\n-\t\t\t      sizeof(struct rte_flow_item_ipv4), error);\n+\t\t\t      &rte_flow_item_tcp_mask,\n+\t\t\t      sizeof(struct rte_flow_item_tcp), error);\n \tif (ret)\n \t\treturn ret;\n \n@@ -1298,8 +1089,8 @@ mrvl_parse_udp(const struct rte_flow_item *item,\n \tint ret;\n \n \tret = mrvl_parse_init(item, (const void **)&spec, (const void **)&mask,\n-\t\t\t      &rte_flow_item_ipv4_mask,\n-\t\t\t      sizeof(struct rte_flow_item_ipv4), error);\n+\t\t\t      &rte_flow_item_udp_mask,\n+\t\t\t      sizeof(struct rte_flow_item_udp), error);\n \tif (ret)\n \t\treturn ret;\n \n@@ -1332,923 +1123,196 @@ mrvl_parse_udp(const struct rte_flow_item *item,\n }\n \n /**\n- * Parse flow pattern composed of the the eth item.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n+ * Structure used to map specific flow pattern to the pattern parse callback\n+ * which will iterate over each pattern item and extract relevant data.\n  */\n-static int\n-mrvl_parse_pattern_eth(const struct rte_flow_item pattern[],\n-\t\t       struct rte_flow *flow,\n-\t\t       struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_eth(pattern, flow, error);\n-}\n+static const struct {\n+\tconst enum rte_flow_item_type pattern_type;\n+\tint (*parse)(const struct rte_flow_item *pattern,\n+\t\tstruct rte_flow *flow,\n+\t\tstruct rte_flow_error *error);\n+} mrvl_patterns[] = {\n+\t{ RTE_FLOW_ITEM_TYPE_ETH, mrvl_parse_eth },\n+\t{ RTE_FLOW_ITEM_TYPE_VLAN, mrvl_parse_vlan },\n+\t{ RTE_FLOW_ITEM_TYPE_IPV4, mrvl_parse_ip4 },\n+\t{ RTE_FLOW_ITEM_TYPE_IPV6, mrvl_parse_ip6 },\n+\t{ RTE_FLOW_ITEM_TYPE_TCP, mrvl_parse_tcp },\n+\t{ RTE_FLOW_ITEM_TYPE_UDP, mrvl_parse_udp },\n+\t{ RTE_FLOW_ITEM_TYPE_END, NULL }\n+};\n \n /**\n- * Parse flow pattern composed of the eth and vlan items.\n+ * Parse flow attribute.\n  *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n+ * This will check whether the provided attribute's flags are supported.\n+ *\n+ * @param priv Unused\n+ * @param attr Pointer to the flow attribute.\n+ * @param flow Unused\n  * @param error Pointer to the flow error.\n  * @returns 0 in case of success, negative value otherwise.\n  */\n static int\n-mrvl_parse_pattern_eth_vlan(const struct rte_flow_item pattern[],\n-\t\t\t    struct rte_flow *flow,\n-\t\t\t    struct rte_flow_error *error)\n+mrvl_flow_parse_attr(struct mrvl_priv *priv __rte_unused,\n+\t\t     const struct rte_flow_attr *attr,\n+\t\t     struct rte_flow *flow __rte_unused,\n+\t\t     struct rte_flow_error *error)\n {\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n-\tint ret;\n-\n-\tret = mrvl_parse_eth(item, flow, error);\n-\tif (ret)\n-\t\treturn ret;\n+\tif (!attr) {\n+\t\trte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ATTR,\n+\t\t\t\t   NULL, \"NULL attribute\");\n+\t\treturn -rte_errno;\n+\t}\n \n-\titem = mrvl_next_item(item + 1);\n+\tif (attr->group) {\n+\t\trte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t   RTE_FLOW_ERROR_TYPE_ATTR_GROUP, NULL,\n+\t\t\t\t   \"Groups are not supported\");\n+\t\treturn -rte_errno;\n+\t}\n+\tif (attr->priority) {\n+\t\trte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t   RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY, NULL,\n+\t\t\t\t   \"Priorities are not supported\");\n+\t\treturn -rte_errno;\n+\t}\n+\tif (!attr->ingress) {\n+\t\trte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t   RTE_FLOW_ERROR_TYPE_ATTR_INGRESS, NULL,\n+\t\t\t\t   \"Only ingress is supported\");\n+\t\treturn -rte_errno;\n+\t}\n+\tif (attr->egress) {\n+\t\trte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t   RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, NULL,\n+\t\t\t\t   \"Egress is not supported\");\n+\t\treturn -rte_errno;\n+\t}\n+\tif (attr->transfer) {\n+\t\trte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t   RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER, NULL,\n+\t\t\t\t   \"Transfer is not supported\");\n+\t\treturn -rte_errno;\n+\t}\n \n-\treturn mrvl_parse_vlan(item, flow, error);\n+\treturn 0;\n }\n \n /**\n- * Parse flow pattern composed of the eth, vlan and ip4/ip6 items.\n+ * Parse flow pattern.\n+ *\n+ * Specific classifier rule will be created as well.\n  *\n- * @param pattern Pointer to the flow pattern table.\n+ * @param priv Unused\n+ * @param pattern Pointer to the flow pattern.\n  * @param flow Pointer to the flow.\n  * @param error Pointer to the flow error.\n- * @param ip6 1 to parse ip6 item, 0 to parse ip4 item.\n  * @returns 0 in case of success, negative value otherwise.\n  */\n static int\n-mrvl_parse_pattern_eth_vlan_ip4_ip6(const struct rte_flow_item pattern[],\n-\t\t\t\t    struct rte_flow *flow,\n-\t\t\t\t    struct rte_flow_error *error, int ip6)\n+mrvl_flow_parse_pattern(struct mrvl_priv *priv __rte_unused,\n+\t\t\tconst struct rte_flow_item pattern[],\n+\t\t\tstruct rte_flow *flow,\n+\t\t\tstruct rte_flow_error *error)\n {\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n+\tunsigned int i, j;\n \tint ret;\n \n-\tret = mrvl_parse_eth(item, flow, error);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\titem = mrvl_next_item(item + 1);\n-\tret = mrvl_parse_vlan(item, flow, error);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\titem = mrvl_next_item(item + 1);\n+\tfor (i = 0; pattern[i].type != RTE_FLOW_ITEM_TYPE_END; i++) {\n+\t\tif (pattern[i].type == RTE_FLOW_ITEM_TYPE_VOID)\n+\t\t\tcontinue;\n+\t\tfor (j = 0; mrvl_patterns[j].pattern_type !=\n+\t\t\tRTE_FLOW_ITEM_TYPE_END; j++) {\n+\t\t\tif (mrvl_patterns[j].pattern_type != pattern[i].type)\n+\t\t\t\tcontinue;\n+\n+\t\t\tif (flow->rule.num_fields >=\n+\t\t\t    PP2_CLS_TBL_MAX_NUM_FIELDS) {\n+\t\t\t\trte_flow_error_set(error, ENOSPC,\n+\t\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM_NUM,\n+\t\t\t\t\t\t   NULL,\n+\t\t\t\t\t\t   \"too many pattern (max %d)\");\n+\t\t\t\treturn -rte_errno;\n+\t\t\t}\n \n-\treturn ip6 ? mrvl_parse_ip6(item, flow, error) :\n-\t\t     mrvl_parse_ip4(item, flow, error);\n-}\n+\t\t\tret = mrvl_patterns[j].parse(&pattern[i], flow, error);\n+\t\t\tif (ret) {\n+\t\t\t\tmrvl_free_all_key_mask(&flow->rule);\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\t\t\tbreak;\n+\t\t}\n+\t\tif (mrvl_patterns[j].pattern_type == RTE_FLOW_ITEM_TYPE_END) {\n+\t\t\trte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM, NULL,\n+\t\t\t\t\t   \"Unsupported pattern\");\n+\t\t\treturn -rte_errno;\n+\t\t}\n+\t}\n \n-/**\n- * Parse flow pattern composed of the eth, vlan and ipv4 items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_parse_pattern_eth_vlan_ip4(const struct rte_flow_item pattern[],\n-\t\t\t\tstruct rte_flow *flow,\n-\t\t\t\tstruct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_eth_vlan_ip4_ip6(pattern, flow, error, 0);\n+\treturn 0;\n }\n \n /**\n- * Parse flow pattern composed of the eth, vlan and ipv6 items.\n+ * Parse flow actions.\n  *\n- * @param pattern Pointer to the flow pattern table.\n+ * @param priv Pointer to the port's private data.\n+ * @param actions Pointer the action table.\n  * @param flow Pointer to the flow.\n  * @param error Pointer to the flow error.\n  * @returns 0 in case of success, negative value otherwise.\n  */\n static int\n-mrvl_parse_pattern_eth_vlan_ip6(const struct rte_flow_item pattern[],\n-\t\t\t\tstruct rte_flow *flow,\n-\t\t\t\tstruct rte_flow_error *error)\n+mrvl_flow_parse_actions(struct mrvl_priv *priv,\n+\t\t\tconst struct rte_flow_action actions[],\n+\t\t\tstruct rte_flow *flow,\n+\t\t\tstruct rte_flow_error *error)\n {\n-\treturn mrvl_parse_pattern_eth_vlan_ip4_ip6(pattern, flow, error, 1);\n-}\n+\tconst struct rte_flow_action *action = actions;\n+\tint specified = 0;\n \n-/**\n- * Parse flow pattern composed of the eth and ip4/ip6 items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @param ip6 1 to parse ip6 item, 0 to parse ip4 item.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_parse_pattern_eth_ip4_ip6(const struct rte_flow_item pattern[],\n-\t\t\t       struct rte_flow *flow,\n-\t\t\t       struct rte_flow_error *error, int ip6)\n-{\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n-\tint ret;\n+\tfor (; action->type != RTE_FLOW_ACTION_TYPE_END; action++) {\n+\t\tif (action->type == RTE_FLOW_ACTION_TYPE_VOID)\n+\t\t\tcontinue;\n \n-\tret = mrvl_parse_eth(item, flow, error);\n-\tif (ret)\n-\t\treturn ret;\n+\t\tif (action->type == RTE_FLOW_ACTION_TYPE_DROP) {\n+\t\t\tflow->cos.ppio = priv->ppio;\n+\t\t\tflow->cos.tc = 0;\n+\t\t\tflow->action.type = PP2_CLS_TBL_ACT_DROP;\n+\t\t\tflow->action.cos = &flow->cos;\n+\t\t\tspecified++;\n+\t\t} else if (action->type == RTE_FLOW_ACTION_TYPE_QUEUE) {\n+\t\t\tconst struct rte_flow_action_queue *q =\n+\t\t\t\t(const struct rte_flow_action_queue *)\n+\t\t\t\taction->conf;\n \n-\titem = mrvl_next_item(item + 1);\n+\t\t\tif (q->index > priv->nb_rx_queues) {\n+\t\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\tNULL,\n+\t\t\t\t\t\t\"Queue index out of range\");\n+\t\t\t\treturn -rte_errno;\n+\t\t\t}\n \n-\treturn ip6 ? mrvl_parse_ip6(item, flow, error) :\n-\t\t     mrvl_parse_ip4(item, flow, error);\n-}\n+\t\t\tif (priv->rxq_map[q->index].tc == MRVL_UNKNOWN_TC) {\n+\t\t\t\t/*\n+\t\t\t\t * Unknown TC mapping, mapping will not have\n+\t\t\t\t * a correct queue.\n+\t\t\t\t */\n+\t\t\t\tMRVL_LOG(ERR,\n+\t\t\t\t\t\"Unknown TC mapping for queue %hu eth%hhu\",\n+\t\t\t\t\tq->index, priv->ppio_id);\n \n-/**\n- * Parse flow pattern composed of the eth and ipv4 items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_eth_ip4(const struct rte_flow_item pattern[],\n-\t\t\t   struct rte_flow *flow,\n-\t\t\t   struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_eth_ip4_ip6(pattern, flow, error, 0);\n-}\n+\t\t\t\trte_flow_error_set(error, EFAULT,\n+\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t\t\t\tNULL, NULL);\n+\t\t\t\treturn -rte_errno;\n+\t\t\t}\n \n-/**\n- * Parse flow pattern composed of the eth and ipv6 items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_eth_ip6(const struct rte_flow_item pattern[],\n-\t\t\t   struct rte_flow *flow,\n-\t\t\t   struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_eth_ip4_ip6(pattern, flow, error, 1);\n-}\n-\n-/**\n- * Parse flow pattern composed of the eth, ip4 and tcp/udp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @param tcp 1 to parse tcp item, 0 to parse udp item.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_parse_pattern_eth_ip4_tcp_udp(const struct rte_flow_item pattern[],\n-\t\t\t\t   struct rte_flow *flow,\n-\t\t\t\t   struct rte_flow_error *error, int tcp)\n-{\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n-\tint ret;\n-\n-\tret = mrvl_parse_pattern_eth_ip4_ip6(pattern, flow, error, 0);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\titem = mrvl_next_item(item + 1);\n-\titem = mrvl_next_item(item + 1);\n-\n-\tif (tcp)\n-\t\treturn mrvl_parse_tcp(item, flow, error);\n-\n-\treturn mrvl_parse_udp(item, flow, error);\n-}\n-\n-/**\n- * Parse flow pattern composed of the eth, ipv4 and tcp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_eth_ip4_tcp(const struct rte_flow_item pattern[],\n-\t\t\t       struct rte_flow *flow,\n-\t\t\t       struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_eth_ip4_tcp_udp(pattern, flow, error, 1);\n-}\n-\n-/**\n- * Parse flow pattern composed of the eth, ipv4 and udp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_eth_ip4_udp(const struct rte_flow_item pattern[],\n-\t\t\t       struct rte_flow *flow,\n-\t\t\t       struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_eth_ip4_tcp_udp(pattern, flow, error, 0);\n-}\n-\n-/**\n- * Parse flow pattern composed of the eth, ipv6 and tcp/udp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @param tcp 1 to parse tcp item, 0 to parse udp item.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_parse_pattern_eth_ip6_tcp_udp(const struct rte_flow_item pattern[],\n-\t\t\t\t   struct rte_flow *flow,\n-\t\t\t\t   struct rte_flow_error *error, int tcp)\n-{\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n-\tint ret;\n-\n-\tret = mrvl_parse_pattern_eth_ip4_ip6(pattern, flow, error, 1);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\titem = mrvl_next_item(item + 1);\n-\titem = mrvl_next_item(item + 1);\n-\n-\tif (tcp)\n-\t\treturn mrvl_parse_tcp(item, flow, error);\n-\n-\treturn mrvl_parse_udp(item, flow, error);\n-}\n-\n-/**\n- * Parse flow pattern composed of the eth, ipv6 and tcp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_eth_ip6_tcp(const struct rte_flow_item pattern[],\n-\t\t\t       struct rte_flow *flow,\n-\t\t\t       struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_eth_ip6_tcp_udp(pattern, flow, error, 1);\n-}\n-\n-/**\n- * Parse flow pattern composed of the eth, ipv6 and udp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_eth_ip6_udp(const struct rte_flow_item pattern[],\n-\t\t\t       struct rte_flow *flow,\n-\t\t\t       struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_eth_ip6_tcp_udp(pattern, flow, error, 0);\n-}\n-\n-/**\n- * Parse flow pattern composed of the vlan item.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_parse_pattern_vlan(const struct rte_flow_item pattern[],\n-\t\t\t    struct rte_flow *flow,\n-\t\t\t    struct rte_flow_error *error)\n-{\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n-\n-\treturn mrvl_parse_vlan(item, flow, error);\n-}\n-\n-/**\n- * Parse flow pattern composed of the vlan and ip4/ip6 items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @param ip6 1 to parse ip6 item, 0 to parse ip4 item.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_parse_pattern_vlan_ip4_ip6(const struct rte_flow_item pattern[],\n-\t\t\t\tstruct rte_flow *flow,\n-\t\t\t\tstruct rte_flow_error *error, int ip6)\n-{\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n-\tint ret;\n-\n-\tret = mrvl_parse_vlan(item, flow, error);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\titem = mrvl_next_item(item + 1);\n-\n-\treturn ip6 ? mrvl_parse_ip6(item, flow, error) :\n-\t\t     mrvl_parse_ip4(item, flow, error);\n-}\n-\n-/**\n- * Parse flow pattern composed of the vlan and ipv4 items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_vlan_ip4(const struct rte_flow_item pattern[],\n-\t\t\t    struct rte_flow *flow,\n-\t\t\t    struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_vlan_ip4_ip6(pattern, flow, error, 0);\n-}\n-\n-/**\n- * Parse flow pattern composed of the vlan, ipv4 and tcp/udp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_parse_pattern_vlan_ip_tcp_udp(const struct rte_flow_item pattern[],\n-\t\t\t\t   struct rte_flow *flow,\n-\t\t\t\t   struct rte_flow_error *error, int tcp)\n-{\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n-\tint ret;\n-\n-\tret = mrvl_parse_pattern_vlan_ip4_ip6(pattern, flow, error, 0);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\titem = mrvl_next_item(item + 1);\n-\titem = mrvl_next_item(item + 1);\n-\n-\tif (tcp)\n-\t\treturn mrvl_parse_tcp(item, flow, error);\n-\n-\treturn mrvl_parse_udp(item, flow, error);\n-}\n-\n-/**\n- * Parse flow pattern composed of the vlan, ipv4 and tcp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_vlan_ip_tcp(const struct rte_flow_item pattern[],\n-\t\t\t       struct rte_flow *flow,\n-\t\t\t       struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_vlan_ip_tcp_udp(pattern, flow, error, 1);\n-}\n-\n-/**\n- * Parse flow pattern composed of the vlan, ipv4 and udp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_vlan_ip_udp(const struct rte_flow_item pattern[],\n-\t\t\t       struct rte_flow *flow,\n-\t\t\t       struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_vlan_ip_tcp_udp(pattern, flow, error, 0);\n-}\n-\n-/**\n- * Parse flow pattern composed of the vlan and ipv6 items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_vlan_ip6(const struct rte_flow_item pattern[],\n-\t\t\t    struct rte_flow *flow,\n-\t\t\t    struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_vlan_ip4_ip6(pattern, flow, error, 1);\n-}\n-\n-/**\n- * Parse flow pattern composed of the vlan, ipv6 and tcp/udp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_parse_pattern_vlan_ip6_tcp_udp(const struct rte_flow_item pattern[],\n-\t\t\t\t    struct rte_flow *flow,\n-\t\t\t\t    struct rte_flow_error *error, int tcp)\n-{\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n-\tint ret;\n-\n-\tret = mrvl_parse_pattern_vlan_ip4_ip6(pattern, flow, error, 1);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\titem = mrvl_next_item(item + 1);\n-\titem = mrvl_next_item(item + 1);\n-\n-\tif (tcp)\n-\t\treturn mrvl_parse_tcp(item, flow, error);\n-\n-\treturn mrvl_parse_udp(item, flow, error);\n-}\n-\n-/**\n- * Parse flow pattern composed of the vlan, ipv6 and tcp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_vlan_ip6_tcp(const struct rte_flow_item pattern[],\n-\t\t\t\tstruct rte_flow *flow,\n-\t\t\t\tstruct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_vlan_ip6_tcp_udp(pattern, flow, error, 1);\n-}\n-\n-/**\n- * Parse flow pattern composed of the vlan, ipv6 and udp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_vlan_ip6_udp(const struct rte_flow_item pattern[],\n-\t\t\t\tstruct rte_flow *flow,\n-\t\t\t\tstruct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_vlan_ip6_tcp_udp(pattern, flow, error, 0);\n-}\n-\n-/**\n- * Parse flow pattern composed of the ip4/ip6 item.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @param ip6 1 to parse ip6 item, 0 to parse ip4 item.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_parse_pattern_ip4_ip6(const struct rte_flow_item pattern[],\n-\t\t       struct rte_flow *flow,\n-\t\t       struct rte_flow_error *error, int ip6)\n-{\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n-\n-\treturn ip6 ? mrvl_parse_ip6(item, flow, error) :\n-\t\t     mrvl_parse_ip4(item, flow, error);\n-}\n-\n-/**\n- * Parse flow pattern composed of the ipv4 item.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_ip4(const struct rte_flow_item pattern[],\n-\t\t       struct rte_flow *flow,\n-\t\t       struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_ip4_ip6(pattern, flow, error, 0);\n-}\n-\n-/**\n- * Parse flow pattern composed of the ipv6 item.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_ip6(const struct rte_flow_item pattern[],\n-\t\t       struct rte_flow *flow,\n-\t\t       struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_ip4_ip6(pattern, flow, error, 1);\n-}\n-\n-/**\n- * Parse flow pattern composed of the ip4/ip6 and tcp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @param ip6 1 to parse ip6 item, 0 to parse ip4 item.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_parse_pattern_ip4_ip6_tcp(const struct rte_flow_item pattern[],\n-\t\t\t   struct rte_flow *flow,\n-\t\t\t   struct rte_flow_error *error, int ip6)\n-{\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n-\tint ret;\n-\n-\tret = ip6 ? mrvl_parse_ip6(item, flow, error) :\n-\t\t    mrvl_parse_ip4(item, flow, error);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\titem = mrvl_next_item(item + 1);\n-\n-\treturn mrvl_parse_tcp(item, flow, error);\n-}\n-\n-/**\n- * Parse flow pattern composed of the ipv4 and tcp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_ip4_tcp(const struct rte_flow_item pattern[],\n-\t\t\t   struct rte_flow *flow,\n-\t\t\t   struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_ip4_ip6_tcp(pattern, flow, error, 0);\n-}\n-\n-/**\n- * Parse flow pattern composed of the ipv6 and tcp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_ip6_tcp(const struct rte_flow_item pattern[],\n-\t\t\t   struct rte_flow *flow,\n-\t\t\t   struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_ip4_ip6_tcp(pattern, flow, error, 1);\n-}\n-\n-/**\n- * Parse flow pattern composed of the ipv4/ipv6 and udp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @param ip6 1 to parse ip6 item, 0 to parse ip4 item.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_parse_pattern_ip4_ip6_udp(const struct rte_flow_item pattern[],\n-\t\t\t   struct rte_flow *flow,\n-\t\t\t   struct rte_flow_error *error, int ip6)\n-{\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n-\tint ret;\n-\n-\tret = ip6 ? mrvl_parse_ip6(item, flow, error) :\n-\t\t    mrvl_parse_ip4(item, flow, error);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\titem = mrvl_next_item(item + 1);\n-\n-\treturn mrvl_parse_udp(item, flow, error);\n-}\n-\n-/**\n- * Parse flow pattern composed of the ipv4 and udp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_ip4_udp(const struct rte_flow_item pattern[],\n-\t\t\t   struct rte_flow *flow,\n-\t\t\t   struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_ip4_ip6_udp(pattern, flow, error, 0);\n-}\n-\n-/**\n- * Parse flow pattern composed of the ipv6 and udp items.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static inline int\n-mrvl_parse_pattern_ip6_udp(const struct rte_flow_item pattern[],\n-\t\t\t   struct rte_flow *flow,\n-\t\t\t   struct rte_flow_error *error)\n-{\n-\treturn mrvl_parse_pattern_ip4_ip6_udp(pattern, flow, error, 1);\n-}\n-\n-/**\n- * Parse flow pattern composed of the tcp item.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_parse_pattern_tcp(const struct rte_flow_item pattern[],\n-\t\t       struct rte_flow *flow,\n-\t\t       struct rte_flow_error *error)\n-{\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n-\n-\treturn mrvl_parse_tcp(item, flow, error);\n-}\n-\n-/**\n- * Parse flow pattern composed of the udp item.\n- *\n- * @param pattern Pointer to the flow pattern table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_parse_pattern_udp(const struct rte_flow_item pattern[],\n-\t\t       struct rte_flow *flow,\n-\t\t       struct rte_flow_error *error)\n-{\n-\tconst struct rte_flow_item *item = mrvl_next_item(pattern);\n-\n-\treturn mrvl_parse_udp(item, flow, error);\n-}\n-\n-/**\n- * Structure used to map specific flow pattern to the pattern parse callback\n- * which will iterate over each pattern item and extract relevant data.\n- */\n-static const struct {\n-\tconst enum rte_flow_item_type *pattern;\n-\tint (*parse)(const struct rte_flow_item pattern[],\n-\t\tstruct rte_flow *flow,\n-\t\tstruct rte_flow_error *error);\n-} mrvl_patterns[] = {\n-\t{ pattern_eth, mrvl_parse_pattern_eth },\n-\t{ pattern_eth_vlan, mrvl_parse_pattern_eth_vlan },\n-\t{ pattern_eth_vlan_ip, mrvl_parse_pattern_eth_vlan_ip4 },\n-\t{ pattern_eth_vlan_ip6, mrvl_parse_pattern_eth_vlan_ip6 },\n-\t{ pattern_eth_ip4, mrvl_parse_pattern_eth_ip4 },\n-\t{ pattern_eth_ip4_tcp, mrvl_parse_pattern_eth_ip4_tcp },\n-\t{ pattern_eth_ip4_udp, mrvl_parse_pattern_eth_ip4_udp },\n-\t{ pattern_eth_ip6, mrvl_parse_pattern_eth_ip6 },\n-\t{ pattern_eth_ip6_tcp, mrvl_parse_pattern_eth_ip6_tcp },\n-\t{ pattern_eth_ip6_udp, mrvl_parse_pattern_eth_ip6_udp },\n-\t{ pattern_vlan, mrvl_parse_pattern_vlan },\n-\t{ pattern_vlan_ip, mrvl_parse_pattern_vlan_ip4 },\n-\t{ pattern_vlan_ip_tcp, mrvl_parse_pattern_vlan_ip_tcp },\n-\t{ pattern_vlan_ip_udp, mrvl_parse_pattern_vlan_ip_udp },\n-\t{ pattern_vlan_ip6, mrvl_parse_pattern_vlan_ip6 },\n-\t{ pattern_vlan_ip6_tcp, mrvl_parse_pattern_vlan_ip6_tcp },\n-\t{ pattern_vlan_ip6_udp, mrvl_parse_pattern_vlan_ip6_udp },\n-\t{ pattern_ip, mrvl_parse_pattern_ip4 },\n-\t{ pattern_ip_tcp, mrvl_parse_pattern_ip4_tcp },\n-\t{ pattern_ip_udp, mrvl_parse_pattern_ip4_udp },\n-\t{ pattern_ip6, mrvl_parse_pattern_ip6 },\n-\t{ pattern_ip6_tcp, mrvl_parse_pattern_ip6_tcp },\n-\t{ pattern_ip6_udp, mrvl_parse_pattern_ip6_udp },\n-\t{ pattern_tcp, mrvl_parse_pattern_tcp },\n-\t{ pattern_udp, mrvl_parse_pattern_udp }\n-};\n-\n-/**\n- * Check whether provided pattern matches any of the supported ones.\n- *\n- * @param type_pattern Pointer to the pattern type.\n- * @param item_pattern Pointer to the flow pattern.\n- * @returns 1 in case of success, 0 value otherwise.\n- */\n-static int\n-mrvl_patterns_match(const enum rte_flow_item_type *type_pattern,\n-\t\t    const struct rte_flow_item *item_pattern)\n-{\n-\tconst enum rte_flow_item_type *type = type_pattern;\n-\tconst struct rte_flow_item *item = item_pattern;\n-\n-\tfor (;;) {\n-\t\tif (item->type == RTE_FLOW_ITEM_TYPE_VOID) {\n-\t\t\titem++;\n-\t\t\tcontinue;\n-\t\t}\n-\n-\t\tif (*type == RTE_FLOW_ITEM_TYPE_END ||\n-\t\t    item->type == RTE_FLOW_ITEM_TYPE_END)\n-\t\t\tbreak;\n-\n-\t\tif (*type != item->type)\n-\t\t\tbreak;\n-\n-\t\titem++;\n-\t\ttype++;\n-\t}\n-\n-\treturn *type == item->type;\n-}\n-\n-/**\n- * Parse flow attribute.\n- *\n- * This will check whether the provided attribute's flags are supported.\n- *\n- * @param priv Unused\n- * @param attr Pointer to the flow attribute.\n- * @param flow Unused\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_flow_parse_attr(struct mrvl_priv *priv __rte_unused,\n-\t\t     const struct rte_flow_attr *attr,\n-\t\t     struct rte_flow *flow __rte_unused,\n-\t\t     struct rte_flow_error *error)\n-{\n-\tif (!attr) {\n-\t\trte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ATTR,\n-\t\t\t\t   NULL, \"NULL attribute\");\n-\t\treturn -rte_errno;\n-\t}\n-\n-\tif (attr->group) {\n-\t\trte_flow_error_set(error, ENOTSUP,\n-\t\t\t\t   RTE_FLOW_ERROR_TYPE_ATTR_GROUP, NULL,\n-\t\t\t\t   \"Groups are not supported\");\n-\t\treturn -rte_errno;\n-\t}\n-\tif (attr->priority) {\n-\t\trte_flow_error_set(error, ENOTSUP,\n-\t\t\t\t   RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY, NULL,\n-\t\t\t\t   \"Priorities are not supported\");\n-\t\treturn -rte_errno;\n-\t}\n-\tif (!attr->ingress) {\n-\t\trte_flow_error_set(error, ENOTSUP,\n-\t\t\t\t   RTE_FLOW_ERROR_TYPE_ATTR_INGRESS, NULL,\n-\t\t\t\t   \"Only ingress is supported\");\n-\t\treturn -rte_errno;\n-\t}\n-\tif (attr->egress) {\n-\t\trte_flow_error_set(error, ENOTSUP,\n-\t\t\t\t   RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, NULL,\n-\t\t\t\t   \"Egress is not supported\");\n-\t\treturn -rte_errno;\n-\t}\n-\tif (attr->transfer) {\n-\t\trte_flow_error_set(error, ENOTSUP,\n-\t\t\t\t   RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER, NULL,\n-\t\t\t\t   \"Transfer is not supported\");\n-\t\treturn -rte_errno;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-/**\n- * Parse flow pattern.\n- *\n- * Specific classifier rule will be created as well.\n- *\n- * @param priv Unused\n- * @param pattern Pointer to the flow pattern.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_flow_parse_pattern(struct mrvl_priv *priv __rte_unused,\n-\t\t\tconst struct rte_flow_item pattern[],\n-\t\t\tstruct rte_flow *flow,\n-\t\t\tstruct rte_flow_error *error)\n-{\n-\tunsigned int i;\n-\tint ret;\n-\n-\tfor (i = 0; i < RTE_DIM(mrvl_patterns); i++) {\n-\t\tif (!mrvl_patterns_match(mrvl_patterns[i].pattern, pattern))\n-\t\t\tcontinue;\n-\n-\t\tret = mrvl_patterns[i].parse(pattern, flow, error);\n-\t\tif (ret)\n-\t\t\tmrvl_free_all_key_mask(&flow->rule);\n-\n-\t\treturn ret;\n-\t}\n-\n-\trte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, NULL,\n-\t\t\t   \"Unsupported pattern\");\n-\n-\treturn -rte_errno;\n-}\n-\n-/**\n- * Parse flow actions.\n- *\n- * @param priv Pointer to the port's private data.\n- * @param actions Pointer the action table.\n- * @param flow Pointer to the flow.\n- * @param error Pointer to the flow error.\n- * @returns 0 in case of success, negative value otherwise.\n- */\n-static int\n-mrvl_flow_parse_actions(struct mrvl_priv *priv,\n-\t\t\tconst struct rte_flow_action actions[],\n-\t\t\tstruct rte_flow *flow,\n-\t\t\tstruct rte_flow_error *error)\n-{\n-\tconst struct rte_flow_action *action = actions;\n-\tint specified = 0;\n-\n-\tfor (; action->type != RTE_FLOW_ACTION_TYPE_END; action++) {\n-\t\tif (action->type == RTE_FLOW_ACTION_TYPE_VOID)\n-\t\t\tcontinue;\n-\n-\t\tif (action->type == RTE_FLOW_ACTION_TYPE_DROP) {\n-\t\t\tflow->cos.ppio = priv->ppio;\n-\t\t\tflow->cos.tc = 0;\n-\t\t\tflow->action.type = PP2_CLS_TBL_ACT_DROP;\n-\t\t\tflow->action.cos = &flow->cos;\n-\t\t\tspecified++;\n-\t\t} else if (action->type == RTE_FLOW_ACTION_TYPE_QUEUE) {\n-\t\t\tconst struct rte_flow_action_queue *q =\n-\t\t\t\t(const struct rte_flow_action_queue *)\n-\t\t\t\taction->conf;\n-\n-\t\t\tif (q->index > priv->nb_rx_queues) {\n-\t\t\t\trte_flow_error_set(error, EINVAL,\n-\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION,\n-\t\t\t\t\t\tNULL,\n-\t\t\t\t\t\t\"Queue index out of range\");\n-\t\t\t\treturn -rte_errno;\n-\t\t\t}\n-\n-\t\t\tif (priv->rxq_map[q->index].tc == MRVL_UNKNOWN_TC) {\n-\t\t\t\t/*\n-\t\t\t\t * Unknown TC mapping, mapping will not have\n-\t\t\t\t * a correct queue.\n-\t\t\t\t */\n-\t\t\t\tMRVL_LOG(ERR,\n-\t\t\t\t\t\"Unknown TC mapping for queue %hu eth%hhu\",\n-\t\t\t\t\tq->index, priv->ppio_id);\n-\n-\t\t\t\trte_flow_error_set(error, EFAULT,\n-\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n-\t\t\t\t\t\tNULL, NULL);\n-\t\t\t\treturn -rte_errno;\n-\t\t\t}\n-\n-\t\t\tMRVL_LOG(DEBUG,\n-\t\t\t\t\"Action: Assign packets to queue %d, tc:%d, q:%d\",\n-\t\t\t\tq->index, priv->rxq_map[q->index].tc,\n-\t\t\t\tpriv->rxq_map[q->index].inq);\n+\t\t\tMRVL_LOG(DEBUG,\n+\t\t\t\t\"Action: Assign packets to queue %d, tc:%d, q:%d\",\n+\t\t\t\tq->index, priv->rxq_map[q->index].tc,\n+\t\t\t\tpriv->rxq_map[q->index].inq);\n \n \t\t\tflow->cos.ppio = priv->ppio;\n \t\t\tflow->cos.tc = priv->rxq_map[q->index].tc;\n@@ -2755,6 +1819,11 @@ mrvl_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)\n \t\trte_free(flow);\n \t}\n \n+\tif (priv->cls_tbl) {\n+\t\tpp2_cls_tbl_deinit(priv->cls_tbl);\n+\t\tpriv->cls_tbl = NULL;\n+\t}\n+\n \treturn 0;\n }\n \n@@ -2813,12 +1882,5 @@ mrvl_flow_init(struct rte_eth_dev *dev)\n void\n mrvl_flow_deinit(struct rte_eth_dev *dev)\n {\n-\tstruct mrvl_priv *priv = dev->data->dev_private;\n-\n \tmrvl_flow_flush(dev, NULL);\n-\n-\tif (priv->cls_tbl) {\n-\t\tpp2_cls_tbl_deinit(priv->cls_tbl);\n-\t\tpriv->cls_tbl = NULL;\n-\t}\n }\n",
    "prefixes": [
        "v2",
        "19/37"
    ]
}