get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 73396,
    "url": "https://patches.dpdk.org/api/patches/73396/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200707092244.12791-18-hemant.agrawal@nxp.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": "<20200707092244.12791-18-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200707092244.12791-18-hemant.agrawal@nxp.com",
    "date": "2020-07-07T09:22:32",
    "name": "[v2,17/29] net/dpaa2: add sanity check for flow extracts",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "d983e7aa8a0a9e19feb6e1b91d7a8f08ec07440a",
    "submitter": {
        "id": 477,
        "url": "https://patches.dpdk.org/api/people/477/?format=api",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200707092244.12791-18-hemant.agrawal@nxp.com/mbox/",
    "series": [
        {
            "id": 10842,
            "url": "https://patches.dpdk.org/api/series/10842/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10842",
            "date": "2020-07-07T09:22:15",
            "name": "NXP DPAAx enhancements",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/10842/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73396/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/73396/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 16119A00BE;\n\tTue,  7 Jul 2020 11:30:21 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9AF481DDD3;\n\tTue,  7 Jul 2020 11:27:25 +0200 (CEST)",
            "from inva020.nxp.com (inva020.nxp.com [92.121.34.13])\n by dpdk.org (Postfix) with ESMTP id A86F51DD29\n for <dev@dpdk.org>; Tue,  7 Jul 2020 11:27:10 +0200 (CEST)",
            "from inva020.nxp.com (localhost [127.0.0.1])\n by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 85A2C1A0A4F;\n Tue,  7 Jul 2020 11:27:10 +0200 (CEST)",
            "from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com\n [165.114.16.14])\n by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 9DF6A1A0A30;\n Tue,  7 Jul 2020 11:27:08 +0200 (CEST)",
            "from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net\n [10.232.133.63])\n by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 61532402A8;\n Tue,  7 Jul 2020 17:27:06 +0800 (SGT)"
        ],
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com,\n\tJun Yang <jun.yang@nxp.com>",
        "Date": "Tue,  7 Jul 2020 14:52:32 +0530",
        "Message-Id": "<20200707092244.12791-18-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200707092244.12791-1-hemant.agrawal@nxp.com>",
        "References": "<20200527132326.1382-1-hemant.agrawal@nxp.com>\n <20200707092244.12791-1-hemant.agrawal@nxp.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "Subject": "[dpdk-dev] [PATCH v2 17/29] net/dpaa2: add sanity check for flow\n\textracts",
        "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: Jun Yang <jun.yang@nxp.com>\n\nDefine extracts support for each protocol and check the fields of each\npattern before building extracts of QoS/FS table.\n\nSigned-off-by: Jun Yang <jun.yang@nxp.com>\n---\n drivers/net/dpaa2/dpaa2_ethdev.c |   7 +-\n drivers/net/dpaa2/dpaa2_flow.c   | 250 +++++++++++++++++++++++++------\n 2 files changed, 204 insertions(+), 53 deletions(-)",
    "diff": "diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c\nindex 492b65840..fd3097c7d 100644\n--- a/drivers/net/dpaa2/dpaa2_ethdev.c\n+++ b/drivers/net/dpaa2/dpaa2_ethdev.c\n@@ -2610,11 +2610,8 @@ dpaa2_dev_uninit(struct rte_eth_dev *eth_dev)\n \teth_dev->process_private = NULL;\n \trte_free(dpni);\n \n-\tfor (i = 0; i < MAX_TCS; i++) {\n-\t\tif (priv->extract.tc_extract_param[i])\n-\t\t\trte_free((void *)\n-\t\t\t\t(size_t)priv->extract.tc_extract_param[i]);\n-\t}\n+\tfor (i = 0; i < MAX_TCS; i++)\n+\t\trte_free((void *)(size_t)priv->extract.tc_extract_param[i]);\n \n \tif (priv->extract.qos_extract_param)\n \t\trte_free((void *)(size_t)priv->extract.qos_extract_param);\ndiff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c\nindex 779cb64ab..507a5d0e3 100644\n--- a/drivers/net/dpaa2/dpaa2_flow.c\n+++ b/drivers/net/dpaa2/dpaa2_flow.c\n@@ -87,7 +87,68 @@ enum rte_flow_action_type dpaa2_supported_action_type[] = {\n #define DPAA2_FLOW_ITEM_TYPE_GENERIC_IP (RTE_FLOW_ITEM_TYPE_META + 1)\n \n enum rte_filter_type dpaa2_filter_type = RTE_ETH_FILTER_NONE;\n-static const void *default_mask;\n+\n+#ifndef __cplusplus\n+static const struct rte_flow_item_eth dpaa2_flow_item_eth_mask = {\n+\t.dst.addr_bytes = \"\\xff\\xff\\xff\\xff\\xff\\xff\",\n+\t.src.addr_bytes = \"\\xff\\xff\\xff\\xff\\xff\\xff\",\n+\t.type = RTE_BE16(0xffff),\n+};\n+\n+static const struct rte_flow_item_vlan dpaa2_flow_item_vlan_mask = {\n+\t.tci = RTE_BE16(0xffff),\n+};\n+\n+static const struct rte_flow_item_ipv4 dpaa2_flow_item_ipv4_mask = {\n+\t.hdr.src_addr = RTE_BE32(0xffffffff),\n+\t.hdr.dst_addr = RTE_BE32(0xffffffff),\n+\t.hdr.next_proto_id = 0xff,\n+};\n+\n+static const struct rte_flow_item_ipv6 dpaa2_flow_item_ipv6_mask = {\n+\t.hdr = {\n+\t\t.src_addr =\n+\t\t\t\"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\"\n+\t\t\t\"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\",\n+\t\t.dst_addr =\n+\t\t\t\"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\"\n+\t\t\t\"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\",\n+\t\t.proto = 0xff\n+\t},\n+};\n+\n+static const struct rte_flow_item_icmp dpaa2_flow_item_icmp_mask = {\n+\t.hdr.icmp_type = 0xff,\n+\t.hdr.icmp_code = 0xff,\n+};\n+\n+static const struct rte_flow_item_udp dpaa2_flow_item_udp_mask = {\n+\t.hdr = {\n+\t\t.src_port = RTE_BE16(0xffff),\n+\t\t.dst_port = RTE_BE16(0xffff),\n+\t},\n+};\n+\n+static const struct rte_flow_item_tcp dpaa2_flow_item_tcp_mask = {\n+\t.hdr = {\n+\t\t.src_port = RTE_BE16(0xffff),\n+\t\t.dst_port = RTE_BE16(0xffff),\n+\t},\n+};\n+\n+static const struct rte_flow_item_sctp dpaa2_flow_item_sctp_mask = {\n+\t.hdr = {\n+\t\t.src_port = RTE_BE16(0xffff),\n+\t\t.dst_port = RTE_BE16(0xffff),\n+\t},\n+};\n+\n+static const struct rte_flow_item_gre dpaa2_flow_item_gre_mask = {\n+\t.protocol = RTE_BE16(0xffff),\n+};\n+\n+#endif\n+\n \n static inline void dpaa2_flow_extract_key_set(\n \tstruct dpaa2_key_info *key_info, int index, uint8_t size)\n@@ -555,6 +616,67 @@ dpaa2_flow_rule_move_ipaddr_tail(\n \treturn 0;\n }\n \n+static int\n+dpaa2_flow_extract_support(\n+\tconst uint8_t *mask_src,\n+\tenum rte_flow_item_type type)\n+{\n+\tchar mask[64];\n+\tint i, size = 0;\n+\tconst char *mask_support = 0;\n+\n+\tswitch (type) {\n+\tcase RTE_FLOW_ITEM_TYPE_ETH:\n+\t\tmask_support = (const char *)&dpaa2_flow_item_eth_mask;\n+\t\tsize = sizeof(struct rte_flow_item_eth);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_VLAN:\n+\t\tmask_support = (const char *)&dpaa2_flow_item_vlan_mask;\n+\t\tsize = sizeof(struct rte_flow_item_vlan);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_IPV4:\n+\t\tmask_support = (const char *)&dpaa2_flow_item_ipv4_mask;\n+\t\tsize = sizeof(struct rte_flow_item_ipv4);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_IPV6:\n+\t\tmask_support = (const char *)&dpaa2_flow_item_ipv6_mask;\n+\t\tsize = sizeof(struct rte_flow_item_ipv6);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_ICMP:\n+\t\tmask_support = (const char *)&dpaa2_flow_item_icmp_mask;\n+\t\tsize = sizeof(struct rte_flow_item_icmp);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_UDP:\n+\t\tmask_support = (const char *)&dpaa2_flow_item_udp_mask;\n+\t\tsize = sizeof(struct rte_flow_item_udp);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_TCP:\n+\t\tmask_support = (const char *)&dpaa2_flow_item_tcp_mask;\n+\t\tsize = sizeof(struct rte_flow_item_tcp);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_SCTP:\n+\t\tmask_support = (const char *)&dpaa2_flow_item_sctp_mask;\n+\t\tsize = sizeof(struct rte_flow_item_sctp);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_GRE:\n+\t\tmask_support = (const char *)&dpaa2_flow_item_gre_mask;\n+\t\tsize = sizeof(struct rte_flow_item_gre);\n+\t\tbreak;\n+\tdefault:\n+\t\treturn -1;\n+\t}\n+\n+\tmemcpy(mask, mask_support, size);\n+\n+\tfor (i = 0; i < size; i++)\n+\t\tmask[i] = (mask[i] | mask_src[i]);\n+\n+\tif (memcmp(mask, mask_support, size))\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n static int\n dpaa2_configure_flow_eth(struct rte_flow *flow,\n \t\t\t struct rte_eth_dev *dev,\n@@ -580,7 +702,7 @@ dpaa2_configure_flow_eth(struct rte_flow *flow,\n \tspec    = (const struct rte_flow_item_eth *)pattern->spec;\n \tlast    = (const struct rte_flow_item_eth *)pattern->last;\n \tmask    = (const struct rte_flow_item_eth *)\n-\t\t(pattern->mask ? pattern->mask : default_mask);\n+\t\t(pattern->mask ? pattern->mask : &dpaa2_flow_item_eth_mask);\n \tif (!spec) {\n \t\t/* Don't care any field of eth header,\n \t\t * only care eth protocol.\n@@ -593,6 +715,13 @@ dpaa2_configure_flow_eth(struct rte_flow *flow,\n \tflow->tc_id = group;\n \tflow->tc_index = attr->priority;\n \n+\tif (dpaa2_flow_extract_support((const uint8_t *)mask,\n+\t\tRTE_FLOW_ITEM_TYPE_ETH)) {\n+\t\tDPAA2_PMD_WARN(\"Extract field(s) of ethernet not support.\");\n+\n+\t\treturn -1;\n+\t}\n+\n \tif (memcmp((const char *)&mask->src, zero_cmp, RTE_ETHER_ADDR_LEN)) {\n \t\tindex = dpaa2_flow_extract_search(\n \t\t\t\t&priv->extract.qos_key_extract.dpkg,\n@@ -819,7 +948,7 @@ dpaa2_configure_flow_vlan(struct rte_flow *flow,\n \tspec    = (const struct rte_flow_item_vlan *)pattern->spec;\n \tlast    = (const struct rte_flow_item_vlan *)pattern->last;\n \tmask    = (const struct rte_flow_item_vlan *)\n-\t\t(pattern->mask ? pattern->mask : default_mask);\n+\t\t(pattern->mask ? pattern->mask : &dpaa2_flow_item_vlan_mask);\n \n \t/* Get traffic class index and flow id to be configured */\n \tflow->tc_id = group;\n@@ -886,6 +1015,13 @@ dpaa2_configure_flow_vlan(struct rte_flow *flow,\n \t\treturn 0;\n \t}\n \n+\tif (dpaa2_flow_extract_support((const uint8_t *)mask,\n+\t\tRTE_FLOW_ITEM_TYPE_VLAN)) {\n+\t\tDPAA2_PMD_WARN(\"Extract field(s) of vlan not support.\");\n+\n+\t\treturn -1;\n+\t}\n+\n \tif (!mask->tci)\n \t\treturn 0;\n \n@@ -990,11 +1126,13 @@ dpaa2_configure_flow_generic_ip(\n \tif (pattern->type == RTE_FLOW_ITEM_TYPE_IPV4) {\n \t\tspec_ipv4 = (const struct rte_flow_item_ipv4 *)pattern->spec;\n \t\tmask_ipv4 = (const struct rte_flow_item_ipv4 *)\n-\t\t\t(pattern->mask ? pattern->mask : default_mask);\n+\t\t\t(pattern->mask ? pattern->mask :\n+\t\t\t\t\t&dpaa2_flow_item_ipv4_mask);\n \t} else {\n \t\tspec_ipv6 = (const struct rte_flow_item_ipv6 *)pattern->spec;\n \t\tmask_ipv6 = (const struct rte_flow_item_ipv6 *)\n-\t\t\t(pattern->mask ? pattern->mask : default_mask);\n+\t\t\t(pattern->mask ? pattern->mask :\n+\t\t\t\t\t&dpaa2_flow_item_ipv6_mask);\n \t}\n \n \t/* Get traffic class index and flow id to be configured */\n@@ -1069,6 +1207,24 @@ dpaa2_configure_flow_generic_ip(\n \t\treturn 0;\n \t}\n \n+\tif (mask_ipv4) {\n+\t\tif (dpaa2_flow_extract_support((const uint8_t *)mask_ipv4,\n+\t\t\tRTE_FLOW_ITEM_TYPE_IPV4)) {\n+\t\t\tDPAA2_PMD_WARN(\"Extract field(s) of IPv4 not support.\");\n+\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n+\tif (mask_ipv6) {\n+\t\tif (dpaa2_flow_extract_support((const uint8_t *)mask_ipv6,\n+\t\t\tRTE_FLOW_ITEM_TYPE_IPV6)) {\n+\t\t\tDPAA2_PMD_WARN(\"Extract field(s) of IPv6 not support.\");\n+\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n \tif (mask_ipv4 && (mask_ipv4->hdr.src_addr ||\n \t\tmask_ipv4->hdr.dst_addr)) {\n \t\tflow->ipaddr_rule.ipaddr_type = FLOW_IPV4_ADDR;\n@@ -1358,7 +1514,7 @@ dpaa2_configure_flow_icmp(struct rte_flow *flow,\n \tspec    = (const struct rte_flow_item_icmp *)pattern->spec;\n \tlast    = (const struct rte_flow_item_icmp *)pattern->last;\n \tmask    = (const struct rte_flow_item_icmp *)\n-\t\t(pattern->mask ? pattern->mask : default_mask);\n+\t\t(pattern->mask ? pattern->mask : &dpaa2_flow_item_icmp_mask);\n \n \t/* Get traffic class index and flow id to be configured */\n \tflow->tc_id = group;\n@@ -1427,6 +1583,13 @@ dpaa2_configure_flow_icmp(struct rte_flow *flow,\n \t\treturn 0;\n \t}\n \n+\tif (dpaa2_flow_extract_support((const uint8_t *)mask,\n+\t\tRTE_FLOW_ITEM_TYPE_ICMP)) {\n+\t\tDPAA2_PMD_WARN(\"Extract field(s) of ICMP not support.\");\n+\n+\t\treturn -1;\n+\t}\n+\n \tif (mask->hdr.icmp_type) {\n \t\tindex = dpaa2_flow_extract_search(\n \t\t\t\t&priv->extract.qos_key_extract.dpkg,\n@@ -1593,7 +1756,7 @@ dpaa2_configure_flow_udp(struct rte_flow *flow,\n \tspec    = (const struct rte_flow_item_udp *)pattern->spec;\n \tlast    = (const struct rte_flow_item_udp *)pattern->last;\n \tmask    = (const struct rte_flow_item_udp *)\n-\t\t(pattern->mask ? pattern->mask : default_mask);\n+\t\t(pattern->mask ? pattern->mask : &dpaa2_flow_item_udp_mask);\n \n \t/* Get traffic class index and flow id to be configured */\n \tflow->tc_id = group;\n@@ -1656,6 +1819,13 @@ dpaa2_configure_flow_udp(struct rte_flow *flow,\n \t\t\treturn 0;\n \t}\n \n+\tif (dpaa2_flow_extract_support((const uint8_t *)mask,\n+\t\tRTE_FLOW_ITEM_TYPE_UDP)) {\n+\t\tDPAA2_PMD_WARN(\"Extract field(s) of UDP not support.\");\n+\n+\t\treturn -1;\n+\t}\n+\n \tif (mask->hdr.src_port) {\n \t\tindex = dpaa2_flow_extract_search(\n \t\t\t\t&priv->extract.qos_key_extract.dpkg,\n@@ -1825,7 +1995,7 @@ dpaa2_configure_flow_tcp(struct rte_flow *flow,\n \tspec    = (const struct rte_flow_item_tcp *)pattern->spec;\n \tlast    = (const struct rte_flow_item_tcp *)pattern->last;\n \tmask    = (const struct rte_flow_item_tcp *)\n-\t\t(pattern->mask ? pattern->mask : default_mask);\n+\t\t(pattern->mask ? pattern->mask : &dpaa2_flow_item_tcp_mask);\n \n \t/* Get traffic class index and flow id to be configured */\n \tflow->tc_id = group;\n@@ -1888,6 +2058,13 @@ dpaa2_configure_flow_tcp(struct rte_flow *flow,\n \t\t\treturn 0;\n \t}\n \n+\tif (dpaa2_flow_extract_support((const uint8_t *)mask,\n+\t\tRTE_FLOW_ITEM_TYPE_TCP)) {\n+\t\tDPAA2_PMD_WARN(\"Extract field(s) of TCP not support.\");\n+\n+\t\treturn -1;\n+\t}\n+\n \tif (mask->hdr.src_port) {\n \t\tindex = dpaa2_flow_extract_search(\n \t\t\t\t&priv->extract.qos_key_extract.dpkg,\n@@ -2058,7 +2235,8 @@ dpaa2_configure_flow_sctp(struct rte_flow *flow,\n \tspec    = (const struct rte_flow_item_sctp *)pattern->spec;\n \tlast    = (const struct rte_flow_item_sctp *)pattern->last;\n \tmask    = (const struct rte_flow_item_sctp *)\n-\t\t\t(pattern->mask ? pattern->mask : default_mask);\n+\t\t\t(pattern->mask ? pattern->mask :\n+\t\t\t\t&dpaa2_flow_item_sctp_mask);\n \n \t/* Get traffic class index and flow id to be configured */\n \tflow->tc_id = group;\n@@ -2121,6 +2299,13 @@ dpaa2_configure_flow_sctp(struct rte_flow *flow,\n \t\t\treturn 0;\n \t}\n \n+\tif (dpaa2_flow_extract_support((const uint8_t *)mask,\n+\t\tRTE_FLOW_ITEM_TYPE_SCTP)) {\n+\t\tDPAA2_PMD_WARN(\"Extract field(s) of SCTP not support.\");\n+\n+\t\treturn -1;\n+\t}\n+\n \tif (mask->hdr.src_port) {\n \t\tindex = dpaa2_flow_extract_search(\n \t\t\t\t&priv->extract.qos_key_extract.dpkg,\n@@ -2291,7 +2476,7 @@ dpaa2_configure_flow_gre(struct rte_flow *flow,\n \tspec    = (const struct rte_flow_item_gre *)pattern->spec;\n \tlast    = (const struct rte_flow_item_gre *)pattern->last;\n \tmask    = (const struct rte_flow_item_gre *)\n-\t\t(pattern->mask ? pattern->mask : default_mask);\n+\t\t(pattern->mask ? pattern->mask : &dpaa2_flow_item_gre_mask);\n \n \t/* Get traffic class index and flow id to be configured */\n \tflow->tc_id = group;\n@@ -2353,6 +2538,13 @@ dpaa2_configure_flow_gre(struct rte_flow *flow,\n \t\treturn 0;\n \t}\n \n+\tif (dpaa2_flow_extract_support((const uint8_t *)mask,\n+\t\tRTE_FLOW_ITEM_TYPE_GRE)) {\n+\t\tDPAA2_PMD_WARN(\"Extract field(s) of GRE not support.\");\n+\n+\t\treturn -1;\n+\t}\n+\n \tif (!mask->protocol)\n \t\treturn 0;\n \n@@ -3155,42 +3347,6 @@ dpaa2_dev_verify_attr(struct dpni_attr *dpni_attr,\n \treturn ret;\n }\n \n-static inline void\n-dpaa2_dev_update_default_mask(const struct rte_flow_item *pattern)\n-{\n-\tswitch (pattern->type) {\n-\tcase RTE_FLOW_ITEM_TYPE_ETH:\n-\t\tdefault_mask = (const void *)&rte_flow_item_eth_mask;\n-\t\tbreak;\n-\tcase RTE_FLOW_ITEM_TYPE_VLAN:\n-\t\tdefault_mask = (const void *)&rte_flow_item_vlan_mask;\n-\t\tbreak;\n-\tcase RTE_FLOW_ITEM_TYPE_IPV4:\n-\t\tdefault_mask = (const void *)&rte_flow_item_ipv4_mask;\n-\t\tbreak;\n-\tcase RTE_FLOW_ITEM_TYPE_IPV6:\n-\t\tdefault_mask = (const void *)&rte_flow_item_ipv6_mask;\n-\t\tbreak;\n-\tcase RTE_FLOW_ITEM_TYPE_ICMP:\n-\t\tdefault_mask = (const void *)&rte_flow_item_icmp_mask;\n-\t\tbreak;\n-\tcase RTE_FLOW_ITEM_TYPE_UDP:\n-\t\tdefault_mask = (const void *)&rte_flow_item_udp_mask;\n-\t\tbreak;\n-\tcase RTE_FLOW_ITEM_TYPE_TCP:\n-\t\tdefault_mask = (const void *)&rte_flow_item_tcp_mask;\n-\t\tbreak;\n-\tcase RTE_FLOW_ITEM_TYPE_SCTP:\n-\t\tdefault_mask = (const void *)&rte_flow_item_sctp_mask;\n-\t\tbreak;\n-\tcase RTE_FLOW_ITEM_TYPE_GRE:\n-\t\tdefault_mask = (const void *)&rte_flow_item_gre_mask;\n-\t\tbreak;\n-\tdefault:\n-\t\tDPAA2_PMD_ERR(\"Invalid pattern type\");\n-\t}\n-}\n-\n static inline int\n dpaa2_dev_verify_patterns(const struct rte_flow_item pattern[])\n {\n@@ -3216,8 +3372,6 @@ dpaa2_dev_verify_patterns(const struct rte_flow_item pattern[])\n \t\t\tret = -EINVAL;\n \t\t\tbreak;\n \t\t}\n-\t\tif ((pattern[j].last) && (!pattern[j].mask))\n-\t\t\tdpaa2_dev_update_default_mask(&pattern[j]);\n \t}\n \n \treturn ret;\n",
    "prefixes": [
        "v2",
        "17/29"
    ]
}