get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 66292,
    "url": "http://patches.dpdk.org/api/patches/66292/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1583405273-14176-4-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-4-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1583405273-14176-4-git-send-email-arybchenko@solarflare.com",
    "date": "2020-03-05T10:47:49",
    "name": "[3/7] net/sfc: generalise the flow specification structure",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "8e5877971da831ddfe9b6101ffeffb7da64aee5a",
    "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-4-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/66292/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/66292/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 7E0F2A0573;\n\tThu,  5 Mar 2020 11:48:21 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1A7981BFF4;\n\tThu,  5 Mar 2020 11:48:09 +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 2D3C41BFD2\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 8D241800056\n for <dev@dpdk.org>; Thu,  5 Mar 2020 10:48:05 +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 025Am1oO016217;\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 3B2C91611DB;\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:49 +0000",
        "Message-ID": "<1583405273-14176-4-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-8.152800-8.000000-10",
        "X-TMASE-MatchedRID": "hYZzZufQP0zFQqbUkZrXp6iUivh0j2Pv6VTG9cZxEjIGmHr1eMxt2UAc\n 6DyoS2rITvVMSfL26EnU887R5LNcl0Kn0ONMVi8wIwk7p1qp3JYUBI/UWYG7Fm+arpqBxtz8Ucy\n 18vdZUE51FRI7YuPVUFZufa4GNXjG3qZ3A4FG8d0HRzaQbsazqFBijjE0XjY+QwZ1vdtoxbz0D+\n xnOt1EhbuYfXKOJxhDF98H7i+ncMuxep6bWhHz/+hsg0dmQfnGZ/rAPfrtWC0jE50lK5mkctinG\n 8HUdKCnFTBB/IBXpeE0F8nDgggpEgpT2W+WREEzhLMcPZH93bw0aXTlOdj8k7qln+jYe7Zhk4ZF\n oyo7DXjNsfGypshROhBMuFih/tZES9MkIndGRihIcJTn2HkqsczzMs2dyeyV3KE8v2LcrN8Y20f\n 1wrB11vKsF+5sMdue1B80af/kGmnOVhREfxDkQwe06kQGFaIWxYt6Ilbxn6mc9mcqY8TkmJcMlk\n svEyXqzEoG29tTLa0NtxOZMiv338eEpZct2GsNo6SeilAvNO6eQRhzcHyUZZEvEP3jON+So8WMk\n QWv6iX7ev9h4HyIA1cppCzPq+1UsjvNV98mpPMqsQovwB+JQQknxXxIf+y/OG/VddCUTWISr4Ti\n vd3DxpcJNAQIg8ilftwZ3X11IV0=",
        "X-TM-AS-User-Approved-Sender": "Yes",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--8.152800-8.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.5.1020-25270.003",
        "X-MDID": "1583405286-hrlrvUGvu-wY",
        "Subject": "[dpdk-dev] [PATCH 3/7] net/sfc: generalise the flow specification\n\tstructure",
        "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\nAdd the concept of a flow specification type.\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 | 137 +++++++++++++++++++++++--------------\n drivers/net/sfc/sfc_flow.h |  25 ++++++-\n 2 files changed, 106 insertions(+), 56 deletions(-)",
    "diff": "diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c\nindex 0826032e0..9be1f9ac8 100644\n--- a/drivers/net/sfc/sfc_flow.c\n+++ b/drivers/net/sfc/sfc_flow.c\n@@ -25,8 +25,8 @@\n #include \"sfc_dp_rx.h\"\n \n /*\n- * At now flow API is implemented in such a manner that each\n- * flow rule is converted to one or more hardware filters.\n+ * Currently, filter-based (VNIC) flow API is implemented in such a manner\n+ * that each flow rule is converted to one or more hardware filters.\n  * All elements of flow rule (attributes, pattern items, actions)\n  * correspond to one or more fields in the efx_filter_spec_s structure\n  * that is responsible for the hardware filter.\n@@ -1093,6 +1093,9 @@ sfc_flow_parse_attr(const struct rte_flow_attr *attr,\n \t\t    struct rte_flow *flow,\n \t\t    struct rte_flow_error *error)\n {\n+\tstruct sfc_flow_spec *spec = &flow->spec;\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n+\n \tif (attr == NULL) {\n \t\trte_flow_error_set(error, EINVAL,\n \t\t\t\t   RTE_FLOW_ERROR_TYPE_ATTR, NULL,\n@@ -1130,8 +1133,9 @@ sfc_flow_parse_attr(const struct rte_flow_attr *attr,\n \t\treturn -rte_errno;\n \t}\n \n-\tflow->spec.template.efs_flags |= EFX_FILTER_FLAG_RX;\n-\tflow->spec.template.efs_rss_context = EFX_RSS_CONTEXT_DEFAULT;\n+\tspec->type = SFC_FLOW_SPEC_FILTER;\n+\tspec_filter->template.efs_flags |= EFX_FILTER_FLAG_RX;\n+\tspec_filter->template.efs_rss_context = EFX_RSS_CONTEXT_DEFAULT;\n \n \treturn 0;\n }\n@@ -1158,6 +1162,8 @@ sfc_flow_parse_pattern(const struct rte_flow_item pattern[],\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@@ -1222,7 +1228,7 @@ sfc_flow_parse_pattern(const struct rte_flow_item pattern[],\n \t\t\tbreak;\n \t\t}\n \n-\t\trc = item->parse(pattern, &flow->spec.template, error);\n+\t\trc = item->parse(pattern, &spec_filter->template, error);\n \t\tif (rc != 0)\n \t\t\treturn rc;\n \n@@ -1238,13 +1244,15 @@ sfc_flow_parse_queue(struct sfc_adapter *sa,\n \t\t     const struct rte_flow_action_queue *queue,\n \t\t     struct rte_flow *flow)\n {\n+\tstruct sfc_flow_spec *spec = &flow->spec;\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n \tstruct sfc_rxq *rxq;\n \n \tif (queue->index >= sfc_sa2shared(sa)->rxq_count)\n \t\treturn -EINVAL;\n \n \trxq = &sa->rxq_ctrl[queue->index];\n-\tflow->spec.template.efs_dmaq_id = (uint16_t)rxq->hw_index;\n+\tspec_filter->template.efs_dmaq_id = (uint16_t)rxq->hw_index;\n \n \treturn 0;\n }\n@@ -1262,7 +1270,9 @@ sfc_flow_parse_rss(struct sfc_adapter *sa,\n \tunsigned int rxq_hw_index_max;\n \tefx_rx_hash_type_t efx_hash_types;\n \tconst uint8_t *rss_key;\n-\tstruct sfc_flow_rss *sfc_rss_conf = &flow->spec.rss_conf;\n+\tstruct sfc_flow_spec *spec = &flow->spec;\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n+\tstruct sfc_flow_rss *sfc_rss_conf = &spec_filter->rss_conf;\n \tunsigned int i;\n \n \tif (action_rss->queue_num == 0)\n@@ -1306,7 +1316,7 @@ sfc_flow_parse_rss(struct sfc_adapter *sa,\n \t */\n \tif (action_rss->queue_num == 1 && action_rss->types == 0 &&\n \t    action_rss->key_len == 0) {\n-\t\tflow->spec.template.efs_dmaq_id = rxq_hw_index_min;\n+\t\tspec_filter->template.efs_dmaq_id = rxq_hw_index_min;\n \t\treturn 0;\n \t}\n \n@@ -1334,7 +1344,7 @@ sfc_flow_parse_rss(struct sfc_adapter *sa,\n \t\trss_key = rss->key;\n \t}\n \n-\tflow->spec.rss = B_TRUE;\n+\tspec_filter->rss = B_TRUE;\n \n \tsfc_rss_conf->rxq_hw_index_min = rxq_hw_index_min;\n \tsfc_rss_conf->rxq_hw_index_max = rxq_hw_index_max;\n@@ -1356,13 +1366,14 @@ static int\n sfc_flow_spec_flush(struct sfc_adapter *sa, struct sfc_flow_spec *spec,\n \t\t    unsigned int filters_count)\n {\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n \tunsigned int i;\n \tint ret = 0;\n \n \tfor (i = 0; i < filters_count; i++) {\n \t\tint rc;\n \n-\t\trc = efx_filter_remove(sa->nic, &spec->filters[i]);\n+\t\trc = efx_filter_remove(sa->nic, &spec_filter->filters[i]);\n \t\tif (ret == 0 && rc != 0) {\n \t\t\tsfc_err(sa, \"failed to remove filter specification \"\n \t\t\t\t\"(rc = %d)\", rc);\n@@ -1376,11 +1387,12 @@ sfc_flow_spec_flush(struct sfc_adapter *sa, struct sfc_flow_spec *spec,\n static int\n sfc_flow_spec_insert(struct sfc_adapter *sa, struct sfc_flow_spec *spec)\n {\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n \tunsigned int i;\n \tint rc = 0;\n \n-\tfor (i = 0; i < spec->count; i++) {\n-\t\trc = efx_filter_insert(sa->nic, &spec->filters[i]);\n+\tfor (i = 0; i < spec_filter->count; i++) {\n+\t\trc = efx_filter_insert(sa->nic, &spec_filter->filters[i]);\n \t\tif (rc != 0) {\n \t\t\tsfc_flow_spec_flush(sa, spec, i);\n \t\t\tbreak;\n@@ -1393,7 +1405,9 @@ sfc_flow_spec_insert(struct sfc_adapter *sa, struct sfc_flow_spec *spec)\n static int\n sfc_flow_spec_remove(struct sfc_adapter *sa, struct sfc_flow_spec *spec)\n {\n-\treturn sfc_flow_spec_flush(sa, spec, spec->count);\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n+\n+\treturn sfc_flow_spec_flush(sa, spec, spec_filter->count);\n }\n \n static int\n@@ -1402,12 +1416,13 @@ sfc_flow_filter_insert(struct sfc_adapter *sa,\n {\n \tstruct sfc_adapter_shared * const sas = sfc_sa2shared(sa);\n \tstruct sfc_rss *rss = &sas->rss;\n-\tstruct sfc_flow_rss *flow_rss = &flow->spec.rss_conf;\n+\tstruct sfc_flow_spec_filter *spec_filter = &flow->spec.filter;\n+\tstruct sfc_flow_rss *flow_rss = &spec_filter->rss_conf;\n \tuint32_t efs_rss_context = EFX_RSS_CONTEXT_DEFAULT;\n \tunsigned int i;\n \tint rc = 0;\n \n-\tif (flow->spec.rss) {\n+\tif (spec_filter->rss) {\n \t\tunsigned int rss_spread = MIN(flow_rss->rxq_hw_index_max -\n \t\t\t\t\t      flow_rss->rxq_hw_index_min + 1,\n \t\t\t\t\t      EFX_MAXRSS);\n@@ -1437,8 +1452,8 @@ sfc_flow_filter_insert(struct sfc_adapter *sa,\n \t\t * RSS behaviour is consistent between them, set the same\n \t\t * RSS context value everywhere.\n \t\t */\n-\t\tfor (i = 0; i < flow->spec.count; i++) {\n-\t\t\tefx_filter_spec_t *spec = &flow->spec.filters[i];\n+\t\tfor (i = 0; i < spec_filter->count; i++) {\n+\t\t\tefx_filter_spec_t *spec = &spec_filter->filters[i];\n \n \t\t\tspec->efs_rss_context = efs_rss_context;\n \t\t\tspec->efs_dmaq_id = flow_rss->rxq_hw_index_min;\n@@ -1450,7 +1465,7 @@ sfc_flow_filter_insert(struct sfc_adapter *sa,\n \tif (rc != 0)\n \t\tgoto fail_filter_insert;\n \n-\tif (flow->spec.rss) {\n+\tif (spec_filter->rss) {\n \t\t/*\n \t\t * Scale table is set after filter insertion because\n \t\t * the table entries are relative to the base RxQ ID\n@@ -1485,19 +1500,20 @@ static int\n sfc_flow_filter_remove(struct sfc_adapter *sa,\n \t\t       struct rte_flow *flow)\n {\n+\tstruct sfc_flow_spec_filter *spec_filter = &flow->spec.filter;\n \tint rc = 0;\n \n \trc = sfc_flow_spec_remove(sa, &flow->spec);\n \tif (rc != 0)\n \t\treturn rc;\n \n-\tif (flow->spec.rss) {\n+\tif (spec_filter->rss) {\n \t\t/*\n \t\t * All specifications for a given flow rule have the same RSS\n \t\t * context, so that RSS context value is taken from the first\n \t\t * filter specification\n \t\t */\n-\t\tefx_filter_spec_t *spec = &flow->spec.filters[0];\n+\t\tefx_filter_spec_t *spec = &spec_filter->filters[0];\n \n \t\trc = efx_rx_scale_context_free(sa->nic, spec->efs_rss_context);\n \t}\n@@ -1510,13 +1526,15 @@ sfc_flow_parse_mark(struct sfc_adapter *sa,\n \t\t    const struct rte_flow_action_mark *mark,\n \t\t    struct rte_flow *flow)\n {\n+\tstruct sfc_flow_spec *spec = &flow->spec;\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n \tconst efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic);\n \n \tif (mark == NULL || mark->id > encp->enc_filter_action_mark_max)\n \t\treturn EINVAL;\n \n-\tflow->spec.template.efs_flags |= EFX_FILTER_FLAG_ACTION_MARK;\n-\tflow->spec.template.efs_mark = mark->id;\n+\tspec_filter->template.efs_flags |= EFX_FILTER_FLAG_ACTION_MARK;\n+\tspec_filter->template.efs_mark = mark->id;\n \n \treturn 0;\n }\n@@ -1528,6 +1546,8 @@ sfc_flow_parse_actions(struct sfc_adapter *sa,\n \t\t       struct rte_flow_error *error)\n {\n \tint rc;\n+\tstruct sfc_flow_spec *spec = &flow->spec;\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n \tconst unsigned int dp_rx_features = sa->priv.dp_rx->features;\n \tuint32_t actions_set = 0;\n \tconst uint32_t fate_actions_mask = (1UL << RTE_FLOW_ACTION_TYPE_QUEUE) |\n@@ -1589,7 +1609,7 @@ sfc_flow_parse_actions(struct sfc_adapter *sa,\n \t\t\tif ((actions_set & fate_actions_mask) != 0)\n \t\t\t\tgoto fail_fate_actions;\n \n-\t\t\tflow->spec.template.efs_dmaq_id =\n+\t\t\tspec_filter->template.efs_dmaq_id =\n \t\t\t\tEFX_FILTER_SPEC_RX_DMAQ_ID_DROP;\n \t\t\tbreak;\n \n@@ -1606,7 +1626,7 @@ sfc_flow_parse_actions(struct sfc_adapter *sa,\n \t\t\t\treturn -rte_errno;\n \t\t\t}\n \n-\t\t\tflow->spec.template.efs_flags |=\n+\t\t\tspec_filter->template.efs_flags |=\n \t\t\t\tEFX_FILTER_FLAG_ACTION_FLAG;\n \t\t\tbreak;\n \n@@ -1645,7 +1665,7 @@ sfc_flow_parse_actions(struct sfc_adapter *sa,\n \n \t/* When fate is unknown, drop traffic. */\n \tif ((actions_set & fate_actions_mask) == 0) {\n-\t\tflow->spec.template.efs_dmaq_id =\n+\t\tspec_filter->template.efs_dmaq_id =\n \t\t\tEFX_FILTER_SPEC_RX_DMAQ_ID_DROP;\n \t}\n \n@@ -1682,12 +1702,13 @@ sfc_flow_set_unknown_dst_flags(struct sfc_flow_spec *spec,\n \t\t\t       struct rte_flow_error *error)\n {\n \tunsigned int i;\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n \tstatic const efx_filter_match_flags_t vals[] = {\n \t\tEFX_FILTER_MATCH_UNKNOWN_UCAST_DST,\n \t\tEFX_FILTER_MATCH_UNKNOWN_MCAST_DST\n \t};\n \n-\tif (filters_count_for_one_val * RTE_DIM(vals) != spec->count) {\n+\tif (filters_count_for_one_val * RTE_DIM(vals) != spec_filter->count) {\n \t\trte_flow_error_set(error, EINVAL,\n \t\t\tRTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n \t\t\t\"Number of specifications is incorrect while copying \"\n@@ -1695,9 +1716,9 @@ sfc_flow_set_unknown_dst_flags(struct sfc_flow_spec *spec,\n \t\treturn -rte_errno;\n \t}\n \n-\tfor (i = 0; i < spec->count; i++) {\n+\tfor (i = 0; i < spec_filter->count; i++) {\n \t\t/* The check above ensures that divisor can't be zero here */\n-\t\tspec->filters[i].efs_match_flags |=\n+\t\tspec_filter->filters[i].efs_match_flags |=\n \t\t\tvals[i / filters_count_for_one_val];\n \t}\n \n@@ -1756,11 +1777,12 @@ sfc_flow_set_ethertypes(struct sfc_flow_spec *spec,\n \t\t\tstruct rte_flow_error *error)\n {\n \tunsigned int i;\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n \tstatic const uint16_t vals[] = {\n \t\tEFX_ETHER_TYPE_IPV4, EFX_ETHER_TYPE_IPV6\n \t};\n \n-\tif (filters_count_for_one_val * RTE_DIM(vals) != spec->count) {\n+\tif (filters_count_for_one_val * RTE_DIM(vals) != spec_filter->count) {\n \t\trte_flow_error_set(error, EINVAL,\n \t\t\tRTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n \t\t\t\"Number of specifications is incorrect \"\n@@ -1768,15 +1790,15 @@ sfc_flow_set_ethertypes(struct sfc_flow_spec *spec,\n \t\treturn -rte_errno;\n \t}\n \n-\tfor (i = 0; i < spec->count; i++) {\n-\t\tspec->filters[i].efs_match_flags |=\n+\tfor (i = 0; i < spec_filter->count; i++) {\n+\t\tspec_filter->filters[i].efs_match_flags |=\n \t\t\tEFX_FILTER_MATCH_ETHER_TYPE;\n \n \t\t/*\n \t\t * The check above ensures that\n \t\t * filters_count_for_one_val is not 0\n \t\t */\n-\t\tspec->filters[i].efs_ether_type =\n+\t\tspec_filter->filters[i].efs_ether_type =\n \t\t\tvals[i / filters_count_for_one_val];\n \t}\n \n@@ -1800,9 +1822,10 @@ sfc_flow_set_outer_vid_flag(struct sfc_flow_spec *spec,\n \t\t\t    unsigned int filters_count_for_one_val,\n \t\t\t    struct rte_flow_error *error)\n {\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n \tunsigned int i;\n \n-\tif (filters_count_for_one_val != spec->count) {\n+\tif (filters_count_for_one_val != spec_filter->count) {\n \t\trte_flow_error_set(error, EINVAL,\n \t\t\tRTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n \t\t\t\"Number of specifications is incorrect \"\n@@ -1810,11 +1833,11 @@ sfc_flow_set_outer_vid_flag(struct sfc_flow_spec *spec,\n \t\treturn -rte_errno;\n \t}\n \n-\tfor (i = 0; i < spec->count; i++) {\n-\t\tspec->filters[i].efs_match_flags |=\n+\tfor (i = 0; i < spec_filter->count; i++) {\n+\t\tspec_filter->filters[i].efs_match_flags |=\n \t\t\tEFX_FILTER_MATCH_OUTER_VID;\n \n-\t\tspec->filters[i].efs_outer_vid = 0;\n+\t\tspec_filter->filters[i].efs_outer_vid = 0;\n \t}\n \n \treturn 0;\n@@ -1839,12 +1862,13 @@ sfc_flow_set_ifrm_unknown_dst_flags(struct sfc_flow_spec *spec,\n \t\t\t\t    struct rte_flow_error *error)\n {\n \tunsigned int i;\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n \tstatic const efx_filter_match_flags_t vals[] = {\n \t\tEFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST,\n \t\tEFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST\n \t};\n \n-\tif (filters_count_for_one_val * RTE_DIM(vals) != spec->count) {\n+\tif (filters_count_for_one_val * RTE_DIM(vals) != spec_filter->count) {\n \t\trte_flow_error_set(error, EINVAL,\n \t\t\tRTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n \t\t\t\"Number of specifications is incorrect while copying \"\n@@ -1852,9 +1876,9 @@ sfc_flow_set_ifrm_unknown_dst_flags(struct sfc_flow_spec *spec,\n \t\treturn -rte_errno;\n \t}\n \n-\tfor (i = 0; i < spec->count; i++) {\n+\tfor (i = 0; i < spec_filter->count; i++) {\n \t\t/* The check above ensures that divisor can't be zero here */\n-\t\tspec->filters[i].efs_match_flags |=\n+\t\tspec_filter->filters[i].efs_match_flags |=\n \t\t\tvals[i / filters_count_for_one_val];\n \t}\n \n@@ -1998,6 +2022,7 @@ sfc_flow_spec_add_match_flag(struct sfc_flow_spec *spec,\n \tunsigned int new_filters_count;\n \tunsigned int filters_count_for_one_val;\n \tconst struct sfc_flow_copy_flag *copy_flag;\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n \tint rc;\n \n \tcopy_flag = sfc_flow_get_copy_flag(flag);\n@@ -2008,7 +2033,7 @@ sfc_flow_spec_add_match_flag(struct sfc_flow_spec *spec,\n \t\treturn -rte_errno;\n \t}\n \n-\tnew_filters_count = spec->count * copy_flag->vals_count;\n+\tnew_filters_count = spec_filter->count * copy_flag->vals_count;\n \tif (new_filters_count > SF_FLOW_SPEC_NB_FILTERS_MAX) {\n \t\trte_flow_error_set(error, EINVAL,\n \t\t\tRTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n@@ -2017,11 +2042,13 @@ sfc_flow_spec_add_match_flag(struct sfc_flow_spec *spec,\n \t}\n \n \t/* Copy filters specifications */\n-\tfor (i = spec->count; i < new_filters_count; i++)\n-\t\tspec->filters[i] = spec->filters[i - spec->count];\n+\tfor (i = spec_filter->count; i < new_filters_count; i++) {\n+\t\tspec_filter->filters[i] =\n+\t\t\tspec_filter->filters[i - spec_filter->count];\n+\t}\n \n-\tfilters_count_for_one_val = spec->count;\n-\tspec->count = new_filters_count;\n+\tfilters_count_for_one_val = spec_filter->count;\n+\tspec_filter->count = new_filters_count;\n \n \trc = copy_flag->set_vals(spec, filters_count_for_one_val, error);\n \tif (rc != 0)\n@@ -2096,6 +2123,7 @@ sfc_flow_spec_filters_complete(struct sfc_adapter *sa,\n \t\t\t       struct sfc_flow_spec *spec,\n \t\t\t       struct rte_flow_error *error)\n {\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n \tstruct sfc_filter *filter = &sa->filter;\n \tefx_filter_match_flags_t miss_flags;\n \tefx_filter_match_flags_t min_miss_flags = 0;\n@@ -2105,12 +2133,12 @@ sfc_flow_spec_filters_complete(struct sfc_adapter *sa,\n \tunsigned int i;\n \tint rc;\n \n-\tmatch = spec->template.efs_match_flags;\n+\tmatch = spec_filter->template.efs_match_flags;\n \tfor (i = 0; i < filter->supported_match_num; i++) {\n \t\tif ((match & filter->supported_match[i]) == match) {\n \t\t\tmiss_flags = filter->supported_match[i] & (~match);\n \t\t\tmultiplier = sfc_flow_check_missing_flags(miss_flags,\n-\t\t\t\t&spec->template, filter);\n+\t\t\t\t&spec_filter->template, filter);\n \t\t\tif (multiplier > 0) {\n \t\t\t\tif (multiplier <= min_multiplier) {\n \t\t\t\t\tmin_multiplier = multiplier;\n@@ -2184,16 +2212,17 @@ sfc_flow_is_match_flags_exception(struct sfc_filter *filter,\n \tuint16_t ether_type;\n \tuint8_t ip_proto;\n \tefx_filter_match_flags_t match_flags;\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n \n-\tfor (i = 0; i < spec->count; i++) {\n-\t\tmatch_flags = spec->filters[i].efs_match_flags;\n+\tfor (i = 0; i < spec_filter->count; i++) {\n+\t\tmatch_flags = spec_filter->filters[i].efs_match_flags;\n \n \t\tif (sfc_flow_is_match_with_vids(match_flags,\n \t\t\t\t\t\tEFX_FILTER_MATCH_ETHER_TYPE) ||\n \t\t    sfc_flow_is_match_with_vids(match_flags,\n \t\t\t\t\t\tEFX_FILTER_MATCH_ETHER_TYPE |\n \t\t\t\t\t\tEFX_FILTER_MATCH_LOC_MAC)) {\n-\t\t\tether_type = spec->filters[i].efs_ether_type;\n+\t\t\tether_type = spec_filter->filters[i].efs_ether_type;\n \t\t\tif (filter->supports_ip_proto_or_addr_filter &&\n \t\t\t    (ether_type == EFX_ETHER_TYPE_IPV4 ||\n \t\t\t     ether_type == EFX_ETHER_TYPE_IPV6))\n@@ -2205,7 +2234,7 @@ sfc_flow_is_match_flags_exception(struct sfc_filter *filter,\n \t\t\t\tEFX_FILTER_MATCH_ETHER_TYPE |\n \t\t\t\tEFX_FILTER_MATCH_IP_PROTO |\n \t\t\t\tEFX_FILTER_MATCH_LOC_MAC)) {\n-\t\t\tip_proto = spec->filters[i].efs_ip_proto;\n+\t\t\tip_proto = spec_filter->filters[i].efs_ip_proto;\n \t\t\tif (filter->supports_rem_or_local_port_filter &&\n \t\t\t    (ip_proto == EFX_IPPROTO_TCP ||\n \t\t\t     ip_proto == EFX_IPPROTO_UDP))\n@@ -2221,13 +2250,15 @@ sfc_flow_validate_match_flags(struct sfc_adapter *sa,\n \t\t\t      struct rte_flow *flow,\n \t\t\t      struct rte_flow_error *error)\n {\n-\tefx_filter_spec_t *spec_tmpl = &flow->spec.template;\n+\tstruct sfc_flow_spec *spec = &flow->spec;\n+\tstruct sfc_flow_spec_filter *spec_filter = &spec->filter;\n+\tefx_filter_spec_t *spec_tmpl = &spec_filter->template;\n \tefx_filter_match_flags_t match_flags = spec_tmpl->efs_match_flags;\n \tint rc;\n \n \t/* Initialize the first filter spec with template */\n-\tflow->spec.filters[0] = *spec_tmpl;\n-\tflow->spec.count = 1;\n+\tspec_filter->filters[0] = *spec_tmpl;\n+\tspec_filter->count = 1;\n \n \tif (!sfc_filter_is_match_supported(sa, match_flags)) {\n \t\trc = sfc_flow_spec_filters_complete(sa, &flow->spec, error);\ndiff --git a/drivers/net/sfc/sfc_flow.h b/drivers/net/sfc/sfc_flow.h\nindex 14a6b5d14..70f0cdf12 100644\n--- a/drivers/net/sfc/sfc_flow.h\n+++ b/drivers/net/sfc/sfc_flow.h\n@@ -35,8 +35,15 @@ struct sfc_flow_rss {\n \tunsigned int\trss_tbl[EFX_RSS_TBL_SIZE];\n };\n \n-/* Filter specification storage */\n-struct sfc_flow_spec {\n+/* Flow engines supported by the implementation */\n+enum sfc_flow_spec_type {\n+\tSFC_FLOW_SPEC_FILTER = 0,\n+\n+\tSFC_FLOW_SPEC_NTYPES\n+};\n+\n+/* VNIC-specific flow specification */\n+struct sfc_flow_spec_filter {\n \t/* partial specification from flow rule */\n \tefx_filter_spec_t template;\n \t/* fully elaborated hardware filters specifications */\n@@ -49,9 +56,21 @@ struct sfc_flow_spec {\n \tstruct sfc_flow_rss rss_conf;\n };\n \n+/* Flow specification */\n+struct sfc_flow_spec {\n+\t/* Flow specification type (engine-based) */\n+\tenum sfc_flow_spec_type type;\n+\n+\tRTE_STD_C11\n+\tunion {\n+\t\t/* Filter-based (VNIC level flows) specification */\n+\t\tstruct sfc_flow_spec_filter filter;\n+\t};\n+};\n+\n /* PMD-specific definition of the opaque type from rte_flow.h */\n struct rte_flow {\n-\tstruct sfc_flow_spec spec;\t/* flow spec for hardware filter(s) */\n+\tstruct sfc_flow_spec spec;\t/* flow specification */\n \tTAILQ_ENTRY(rte_flow) entries;\t/* flow list entries */\n };\n \n",
    "prefixes": [
        "3/7"
    ]
}