get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 66294,
    "url": "http://patches.dpdk.org/api/patches/66294/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1583405273-14176-8-git-send-email-arybchenko@solarflare.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": "<1583405273-14176-8-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1583405273-14176-8-git-send-email-arybchenko@solarflare.com",
    "date": "2020-03-05T10:47:53",
    "name": "[7/7] net/sfc: generalise flow pattern item processing",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "6ee6fdd9996f6c86c35b9353aeb656fb8de0721f",
    "submitter": {
        "id": 607,
        "url": "http://patches.dpdk.org/api/people/607/?format=api",
        "name": "Andrew Rybchenko",
        "email": "arybchenko@solarflare.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1583405273-14176-8-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [
        {
            "id": 8796,
            "url": "http://patches.dpdk.org/api/series/8796/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8796",
            "date": "2020-03-05T10:47:46",
            "name": "net/sfc: prepare rte_flow to have one more backend",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/8796/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/66294/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/66294/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 DF7A6A0573;\n\tThu,  5 Mar 2020 11:48:42 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 5AC5E1C011;\n\tThu,  5 Mar 2020 11:48:12 +0100 (CET)",
            "from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com\n [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id F1DA81BFEB\n for <dev@dpdk.org>; Thu,  5 Mar 2020 11:48:07 +0100 (CET)",
            "from webmail.solarflare.com (uk.solarflare.com [193.34.186.16])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))\n (No client certificate requested)\n by mx1-us4.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id\n 8EFA9800056\n for <dev@dpdk.org>; Thu,  5 Mar 2020 10:48:06 +0000 (UTC)",
            "from ukex01.SolarFlarecom.com (10.17.10.4) by\n ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id\n 15.0.1395.4; Thu, 5 Mar 2020 10:48:01 +0000",
            "from opal.uk.solarflarecom.com (10.17.10.1) by\n ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id\n 15.0.1395.4 via Frontend Transport; Thu, 5 Mar 2020 10:48:01 +0000",
            "from ukv-loginhost.uk.solarflarecom.com\n (ukv-loginhost.uk.solarflarecom.com [10.17.10.39])\n by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 025Am1kq016232;\n Thu, 5 Mar 2020 10:48:01 GMT",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 6FF1A1611DB;\n Thu,  5 Mar 2020 10:48:01 +0000 (GMT)"
        ],
        "X-Virus-Scanned": "Proofpoint Essentials engine",
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Ivan Malov <ivan.malov@oktetlabs.ru>",
        "Date": "Thu, 5 Mar 2020 10:47:53 +0000",
        "Message-ID": "<1583405273-14176-8-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1583405273-14176-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1583405273-14176-1-git-send-email-arybchenko@solarflare.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-TM-AS-Product-Ver": "SMEX-12.5.0.1300-8.5.1020-25270.003",
        "X-TM-AS-Result": "No-5.062900-8.000000-10",
        "X-TMASE-MatchedRID": "kjVVIg7nRdv2a0gnUM1gb6iUivh0j2Pv6VTG9cZxEjIGmHr1eMxt2UAc\n 6DyoS2rIqQ4DH3i/D95W05yS+BVHCJA8O/feMrFodhnFihmbnwXYuVu0X/rOkPp5Xn4sBppf7vf\n jHqfMw2JZt5E46LnjwWsjloIqWWFuIi0t/K1GG+Scnm0v4tsY48jjuAIJKiehJLfQYoCQHFZHKo\n wsiP9YDYZzYQB1HkEVmhe/jAJ3e7x2Pde1/jz6evFanwH6mNosfS0Ip2eEHnz3IzXlXlpamPoLR\n 4+zsDTtsrb89fxd0AXvK5uSHWlk2Qji5wBDF3AnNTljQ7P96kMbD2L6tl/sNlZca9RSYo/b",
        "X-TM-AS-User-Approved-Sender": "Yes",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--5.062900-8.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.5.1020-25270.003",
        "X-MDID": "1583405287-aJ2WxpZ7t_hK",
        "Subject": "[dpdk-dev] [PATCH 7/7] net/sfc: generalise flow pattern item\n\tprocessing",
        "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": "From: Ivan Malov <ivan.malov@oktetlabs.ru>\n\nThis is needed to reuse pattern processing engine for MAE.\n\nSigned-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n drivers/net/sfc/sfc_flow.c | 101 ++++++++++++++++++++++---------------\n drivers/net/sfc/sfc_flow.h |  52 +++++++++++++++++++\n 2 files changed, 111 insertions(+), 42 deletions(-)",
    "diff": "diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c\nindex b95acff31..ec0ca3cd6 100644\n--- a/drivers/net/sfc/sfc_flow.c\n+++ b/drivers/net/sfc/sfc_flow.c\n@@ -69,25 +69,6 @@ sfc_flow_get_ops_by_spec(struct rte_flow *flow)\n  * of such a field.\n  */\n \n-enum sfc_flow_item_layers {\n-\tSFC_FLOW_ITEM_ANY_LAYER,\n-\tSFC_FLOW_ITEM_START_LAYER,\n-\tSFC_FLOW_ITEM_L2,\n-\tSFC_FLOW_ITEM_L3,\n-\tSFC_FLOW_ITEM_L4,\n-};\n-\n-typedef int (sfc_flow_item_parse)(const struct rte_flow_item *item,\n-\t\t\t\t  efx_filter_spec_t *spec,\n-\t\t\t\t  struct rte_flow_error *error);\n-\n-struct sfc_flow_item {\n-\tenum rte_flow_item_type type;\t\t/* Type of item */\n-\tenum sfc_flow_item_layers layer;\t/* Layer of item */\n-\tenum sfc_flow_item_layers prev_layer;\t/* Previous layer of item */\n-\tsfc_flow_item_parse *parse;\t\t/* Parsing function */\n-};\n-\n static sfc_flow_item_parse sfc_flow_parse_void;\n static sfc_flow_item_parse sfc_flow_parse_eth;\n static sfc_flow_item_parse sfc_flow_parse_vlan;\n@@ -144,7 +125,7 @@ sfc_flow_is_zero(const uint8_t *buf, unsigned int size)\n /*\n  * Validate item and prepare structures spec and mask for parsing\n  */\n-static int\n+int\n sfc_flow_parse_init(const struct rte_flow_item *item,\n \t\t    const void **spec_ptr,\n \t\t    const void **mask_ptr,\n@@ -243,7 +224,7 @@ sfc_flow_parse_init(const struct rte_flow_item *item,\n \n static int\n sfc_flow_parse_void(__rte_unused const struct rte_flow_item *item,\n-\t\t    __rte_unused efx_filter_spec_t *efx_spec,\n+\t\t    __rte_unused struct sfc_flow_parse_ctx *parse_ctx,\n \t\t    __rte_unused struct rte_flow_error *error)\n {\n \treturn 0;\n@@ -265,10 +246,11 @@ sfc_flow_parse_void(__rte_unused const struct rte_flow_item *item,\n  */\n static int\n sfc_flow_parse_eth(const struct rte_flow_item *item,\n-\t\t   efx_filter_spec_t *efx_spec,\n+\t\t   struct sfc_flow_parse_ctx *parse_ctx,\n \t\t   struct rte_flow_error *error)\n {\n \tint rc;\n+\tefx_filter_spec_t *efx_spec = parse_ctx->filter;\n \tconst struct rte_flow_item_eth *spec = NULL;\n \tconst struct rte_flow_item_eth *mask = NULL;\n \tconst struct rte_flow_item_eth supp_mask = {\n@@ -377,11 +359,12 @@ sfc_flow_parse_eth(const struct rte_flow_item *item,\n  */\n static int\n sfc_flow_parse_vlan(const struct rte_flow_item *item,\n-\t\t    efx_filter_spec_t *efx_spec,\n+\t\t    struct sfc_flow_parse_ctx *parse_ctx,\n \t\t    struct rte_flow_error *error)\n {\n \tint rc;\n \tuint16_t vid;\n+\tefx_filter_spec_t *efx_spec = parse_ctx->filter;\n \tconst struct rte_flow_item_vlan *spec = NULL;\n \tconst struct rte_flow_item_vlan *mask = NULL;\n \tconst struct rte_flow_item_vlan supp_mask = {\n@@ -463,10 +446,11 @@ sfc_flow_parse_vlan(const struct rte_flow_item *item,\n  */\n static int\n sfc_flow_parse_ipv4(const struct rte_flow_item *item,\n-\t\t    efx_filter_spec_t *efx_spec,\n+\t\t    struct sfc_flow_parse_ctx *parse_ctx,\n \t\t    struct rte_flow_error *error)\n {\n \tint rc;\n+\tefx_filter_spec_t *efx_spec = parse_ctx->filter;\n \tconst struct rte_flow_item_ipv4 *spec = NULL;\n \tconst struct rte_flow_item_ipv4 *mask = NULL;\n \tconst uint16_t ether_type_ipv4 = rte_cpu_to_le_16(EFX_ETHER_TYPE_IPV4);\n@@ -553,10 +537,11 @@ sfc_flow_parse_ipv4(const struct rte_flow_item *item,\n  */\n static int\n sfc_flow_parse_ipv6(const struct rte_flow_item *item,\n-\t\t    efx_filter_spec_t *efx_spec,\n+\t\t    struct sfc_flow_parse_ctx *parse_ctx,\n \t\t    struct rte_flow_error *error)\n {\n \tint rc;\n+\tefx_filter_spec_t *efx_spec = parse_ctx->filter;\n \tconst struct rte_flow_item_ipv6 *spec = NULL;\n \tconst struct rte_flow_item_ipv6 *mask = NULL;\n \tconst uint16_t ether_type_ipv6 = rte_cpu_to_le_16(EFX_ETHER_TYPE_IPV6);\n@@ -661,10 +646,11 @@ sfc_flow_parse_ipv6(const struct rte_flow_item *item,\n  */\n static int\n sfc_flow_parse_tcp(const struct rte_flow_item *item,\n-\t\t   efx_filter_spec_t *efx_spec,\n+\t\t   struct sfc_flow_parse_ctx *parse_ctx,\n \t\t   struct rte_flow_error *error)\n {\n \tint rc;\n+\tefx_filter_spec_t *efx_spec = parse_ctx->filter;\n \tconst struct rte_flow_item_tcp *spec = NULL;\n \tconst struct rte_flow_item_tcp *mask = NULL;\n \tconst struct rte_flow_item_tcp supp_mask = {\n@@ -742,10 +728,11 @@ sfc_flow_parse_tcp(const struct rte_flow_item *item,\n  */\n static int\n sfc_flow_parse_udp(const struct rte_flow_item *item,\n-\t\t   efx_filter_spec_t *efx_spec,\n+\t\t   struct sfc_flow_parse_ctx *parse_ctx,\n \t\t   struct rte_flow_error *error)\n {\n \tint rc;\n+\tefx_filter_spec_t *efx_spec = parse_ctx->filter;\n \tconst struct rte_flow_item_udp *spec = NULL;\n \tconst struct rte_flow_item_udp *mask = NULL;\n \tconst struct rte_flow_item_udp supp_mask = {\n@@ -900,10 +887,11 @@ sfc_flow_set_efx_spec_vni_or_vsid(efx_filter_spec_t *efx_spec,\n  */\n static int\n sfc_flow_parse_vxlan(const struct rte_flow_item *item,\n-\t\t     efx_filter_spec_t *efx_spec,\n+\t\t     struct sfc_flow_parse_ctx *parse_ctx,\n \t\t     struct rte_flow_error *error)\n {\n \tint rc;\n+\tefx_filter_spec_t *efx_spec = parse_ctx->filter;\n \tconst struct rte_flow_item_vxlan *spec = NULL;\n \tconst struct rte_flow_item_vxlan *mask = NULL;\n \tconst struct rte_flow_item_vxlan supp_mask = {\n@@ -952,10 +940,11 @@ sfc_flow_parse_vxlan(const struct rte_flow_item *item,\n  */\n static int\n sfc_flow_parse_geneve(const struct rte_flow_item *item,\n-\t\t      efx_filter_spec_t *efx_spec,\n+\t\t      struct sfc_flow_parse_ctx *parse_ctx,\n \t\t      struct rte_flow_error *error)\n {\n \tint rc;\n+\tefx_filter_spec_t *efx_spec = parse_ctx->filter;\n \tconst struct rte_flow_item_geneve *spec = NULL;\n \tconst struct rte_flow_item_geneve *mask = NULL;\n \tconst struct rte_flow_item_geneve supp_mask = {\n@@ -1019,10 +1008,11 @@ sfc_flow_parse_geneve(const struct rte_flow_item *item,\n  */\n static int\n sfc_flow_parse_nvgre(const struct rte_flow_item *item,\n-\t\t     efx_filter_spec_t *efx_spec,\n+\t\t     struct sfc_flow_parse_ctx *parse_ctx,\n \t\t     struct rte_flow_error *error)\n {\n \tint rc;\n+\tefx_filter_spec_t *efx_spec = parse_ctx->filter;\n \tconst struct rte_flow_item_nvgre *spec = NULL;\n \tconst struct rte_flow_item_nvgre *mask = NULL;\n \tconst struct rte_flow_item_nvgre supp_mask = {\n@@ -1061,60 +1051,70 @@ static const struct sfc_flow_item sfc_flow_items[] = {\n \t\t.type = RTE_FLOW_ITEM_TYPE_VOID,\n \t\t.prev_layer = SFC_FLOW_ITEM_ANY_LAYER,\n \t\t.layer = SFC_FLOW_ITEM_ANY_LAYER,\n+\t\t.ctx_type = SFC_FLOW_PARSE_CTX_FILTER,\n \t\t.parse = sfc_flow_parse_void,\n \t},\n \t{\n \t\t.type = RTE_FLOW_ITEM_TYPE_ETH,\n \t\t.prev_layer = SFC_FLOW_ITEM_START_LAYER,\n \t\t.layer = SFC_FLOW_ITEM_L2,\n+\t\t.ctx_type = SFC_FLOW_PARSE_CTX_FILTER,\n \t\t.parse = sfc_flow_parse_eth,\n \t},\n \t{\n \t\t.type = RTE_FLOW_ITEM_TYPE_VLAN,\n \t\t.prev_layer = SFC_FLOW_ITEM_L2,\n \t\t.layer = SFC_FLOW_ITEM_L2,\n+\t\t.ctx_type = SFC_FLOW_PARSE_CTX_FILTER,\n \t\t.parse = sfc_flow_parse_vlan,\n \t},\n \t{\n \t\t.type = RTE_FLOW_ITEM_TYPE_IPV4,\n \t\t.prev_layer = SFC_FLOW_ITEM_L2,\n \t\t.layer = SFC_FLOW_ITEM_L3,\n+\t\t.ctx_type = SFC_FLOW_PARSE_CTX_FILTER,\n \t\t.parse = sfc_flow_parse_ipv4,\n \t},\n \t{\n \t\t.type = RTE_FLOW_ITEM_TYPE_IPV6,\n \t\t.prev_layer = SFC_FLOW_ITEM_L2,\n \t\t.layer = SFC_FLOW_ITEM_L3,\n+\t\t.ctx_type = SFC_FLOW_PARSE_CTX_FILTER,\n \t\t.parse = sfc_flow_parse_ipv6,\n \t},\n \t{\n \t\t.type = RTE_FLOW_ITEM_TYPE_TCP,\n \t\t.prev_layer = SFC_FLOW_ITEM_L3,\n \t\t.layer = SFC_FLOW_ITEM_L4,\n+\t\t.ctx_type = SFC_FLOW_PARSE_CTX_FILTER,\n \t\t.parse = sfc_flow_parse_tcp,\n \t},\n \t{\n \t\t.type = RTE_FLOW_ITEM_TYPE_UDP,\n \t\t.prev_layer = SFC_FLOW_ITEM_L3,\n \t\t.layer = SFC_FLOW_ITEM_L4,\n+\t\t.ctx_type = SFC_FLOW_PARSE_CTX_FILTER,\n \t\t.parse = sfc_flow_parse_udp,\n \t},\n \t{\n \t\t.type = RTE_FLOW_ITEM_TYPE_VXLAN,\n \t\t.prev_layer = SFC_FLOW_ITEM_L4,\n \t\t.layer = SFC_FLOW_ITEM_START_LAYER,\n+\t\t.ctx_type = SFC_FLOW_PARSE_CTX_FILTER,\n \t\t.parse = sfc_flow_parse_vxlan,\n \t},\n \t{\n \t\t.type = RTE_FLOW_ITEM_TYPE_GENEVE,\n \t\t.prev_layer = SFC_FLOW_ITEM_L4,\n \t\t.layer = SFC_FLOW_ITEM_START_LAYER,\n+\t\t.ctx_type = SFC_FLOW_PARSE_CTX_FILTER,\n \t\t.parse = sfc_flow_parse_geneve,\n \t},\n \t{\n \t\t.type = RTE_FLOW_ITEM_TYPE_NVGRE,\n \t\t.prev_layer = SFC_FLOW_ITEM_L3,\n \t\t.layer = SFC_FLOW_ITEM_START_LAYER,\n+\t\t.ctx_type = SFC_FLOW_PARSE_CTX_FILTER,\n \t\t.parse = sfc_flow_parse_nvgre,\n \t},\n };\n@@ -1176,28 +1176,30 @@ sfc_flow_parse_attr(const struct rte_flow_attr *attr,\n \n /* Get item from array sfc_flow_items */\n static const struct sfc_flow_item *\n-sfc_flow_get_item(enum rte_flow_item_type type)\n+sfc_flow_get_item(const struct sfc_flow_item *items,\n+\t\t  unsigned int nb_items,\n+\t\t  enum rte_flow_item_type type)\n {\n \tunsigned int i;\n \n-\tfor (i = 0; i < RTE_DIM(sfc_flow_items); i++)\n-\t\tif (sfc_flow_items[i].type == type)\n-\t\t\treturn &sfc_flow_items[i];\n+\tfor (i = 0; i < nb_items; i++)\n+\t\tif (items[i].type == type)\n+\t\t\treturn &items[i];\n \n \treturn NULL;\n }\n \n-static int\n-sfc_flow_parse_pattern(const struct rte_flow_item pattern[],\n-\t\t       struct rte_flow *flow,\n+int\n+sfc_flow_parse_pattern(const struct sfc_flow_item *flow_items,\n+\t\t       unsigned int nb_flow_items,\n+\t\t       const struct rte_flow_item pattern[],\n+\t\t       struct sfc_flow_parse_ctx *parse_ctx,\n \t\t       struct rte_flow_error *error)\n {\n \tint rc;\n \tunsigned int prev_layer = SFC_FLOW_ITEM_ANY_LAYER;\n \tboolean_t is_ifrm = B_FALSE;\n \tconst struct sfc_flow_item *item;\n-\tstruct sfc_flow_spec *spec = &flow->spec;\n-\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n \n \tif (pattern == NULL) {\n \t\trte_flow_error_set(error, EINVAL,\n@@ -1207,7 +1209,8 @@ sfc_flow_parse_pattern(const struct rte_flow_item pattern[],\n \t}\n \n \tfor (; pattern->type != RTE_FLOW_ITEM_TYPE_END; pattern++) {\n-\t\titem = sfc_flow_get_item(pattern->type);\n+\t\titem = sfc_flow_get_item(flow_items, nb_flow_items,\n+\t\t\t\t\t pattern->type);\n \t\tif (item == NULL) {\n \t\t\trte_flow_error_set(error, ENOTSUP,\n \t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM, pattern,\n@@ -1262,7 +1265,14 @@ sfc_flow_parse_pattern(const struct rte_flow_item pattern[],\n \t\t\tbreak;\n \t\t}\n \n-\t\trc = item->parse(pattern, &spec_filter->template, error);\n+\t\tif (parse_ctx->type != item->ctx_type) {\n+\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM, pattern,\n+\t\t\t\t\t\"Parse context type mismatch\");\n+\t\t\treturn -rte_errno;\n+\t\t}\n+\n+\t\trc = item->parse(pattern, parse_ctx, error);\n \t\tif (rc != 0)\n \t\t\treturn rc;\n \n@@ -2318,9 +2328,16 @@ sfc_flow_parse_rte_to_filter(struct rte_eth_dev *dev,\n \t\t\t     struct rte_flow_error *error)\n {\n \tstruct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev);\n+\tstruct sfc_flow_spec *spec = &flow->spec;\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n+\tstruct sfc_flow_parse_ctx ctx;\n \tint rc;\n \n-\trc = sfc_flow_parse_pattern(pattern, flow, error);\n+\tctx.type = SFC_FLOW_PARSE_CTX_FILTER;\n+\tctx.filter = &spec_filter->template;\n+\n+\trc = sfc_flow_parse_pattern(sfc_flow_items, RTE_DIM(sfc_flow_items),\n+\t\t\t\t    pattern, &ctx, error);\n \tif (rc != 0)\n \t\tgoto fail_bad_value;\n \ndiff --git a/drivers/net/sfc/sfc_flow.h b/drivers/net/sfc/sfc_flow.h\nindex 5d87212c1..0a87924b2 100644\n--- a/drivers/net/sfc/sfc_flow.h\n+++ b/drivers/net/sfc/sfc_flow.h\n@@ -78,6 +78,58 @@ TAILQ_HEAD(sfc_flow_list, rte_flow);\n \n extern const struct rte_flow_ops sfc_flow_ops;\n \n+enum sfc_flow_item_layers {\n+\tSFC_FLOW_ITEM_ANY_LAYER,\n+\tSFC_FLOW_ITEM_START_LAYER,\n+\tSFC_FLOW_ITEM_L2,\n+\tSFC_FLOW_ITEM_L3,\n+\tSFC_FLOW_ITEM_L4,\n+};\n+\n+/* Flow parse context types */\n+enum sfc_flow_parse_ctx_type {\n+\tSFC_FLOW_PARSE_CTX_FILTER = 0,\n+\n+\tSFC_FLOW_PARSE_CTX_NTYPES\n+};\n+\n+/* Flow parse context */\n+struct sfc_flow_parse_ctx {\n+\tenum sfc_flow_parse_ctx_type type;\n+\n+\tRTE_STD_C11\n+\tunion {\n+\t\t/* Context pointer valid for filter-based (VNIC) flows */\n+\t\tefx_filter_spec_t *filter;\n+\t};\n+};\n+\n+typedef int (sfc_flow_item_parse)(const struct rte_flow_item *item,\n+\t\t\t\t  struct sfc_flow_parse_ctx *parse_ctx,\n+\t\t\t\t  struct rte_flow_error *error);\n+\n+struct sfc_flow_item {\n+\tenum rte_flow_item_type type;\t\t/* Type of item */\n+\tenum sfc_flow_item_layers layer;\t/* Layer of item */\n+\tenum sfc_flow_item_layers prev_layer;\t/* Previous layer of item */\n+\tenum sfc_flow_parse_ctx_type ctx_type;\t/* Parse context type */\n+\tsfc_flow_item_parse *parse;\t\t/* Parsing function */\n+};\n+\n+int sfc_flow_parse_pattern(const struct sfc_flow_item *flow_items,\n+\t\t\t   unsigned int nb_flow_items,\n+\t\t\t   const struct rte_flow_item pattern[],\n+\t\t\t   struct sfc_flow_parse_ctx *parse_ctx,\n+\t\t\t   struct rte_flow_error *error);\n+\n+int sfc_flow_parse_init(const struct rte_flow_item *item,\n+\t\t\tconst void **spec_ptr,\n+\t\t\tconst void **mask_ptr,\n+\t\t\tconst void *supp_mask,\n+\t\t\tconst void *def_mask,\n+\t\t\tunsigned int size,\n+\t\t\tstruct rte_flow_error *error);\n+\n struct sfc_adapter;\n \n void sfc_flow_init(struct sfc_adapter *sa);\n",
    "prefixes": [
        "7/7"
    ]
}