Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/86394/?format=api
https://patches.dpdk.org/api/patches/86394/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210112093243.40840-4-jia.guo@intel.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20210112093243.40840-4-jia.guo@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210112093243.40840-4-jia.guo@intel.com", "date": "2021-01-12T09:32:43", "name": "[v3,3/3] net/ice: refactor PTYPE parsing", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "752b4fc0b6bac04251a4e1f65365efad67b372ae", "submitter": { "id": 507, "url": "https://patches.dpdk.org/api/people/507/?format=api", "name": "Guo, Jia", "email": "jia.guo@intel.com" }, "delegate": { "id": 1540, "url": "https://patches.dpdk.org/api/users/1540/?format=api", "username": "qzhan15", "first_name": "Qi", "last_name": "Zhang", "email": "qi.z.zhang@intel.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210112093243.40840-4-jia.guo@intel.com/mbox/", "series": [ { "id": 14666, "url": "https://patches.dpdk.org/api/series/14666/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14666", "date": "2021-01-12T09:32:40", "name": "net/ice: refactor PTYPE parsing", "version": 3, "mbox": "https://patches.dpdk.org/series/14666/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/86394/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/86394/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 D9EB0A04B5;\n\tTue, 12 Jan 2021 10:39:29 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 544F2140DD3;\n\tTue, 12 Jan 2021 10:39:19 +0100 (CET)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id C5BBD140DCE\n for <dev@dpdk.org>; Tue, 12 Jan 2021 10:39:16 +0100 (CET)", "from orsmga008.jf.intel.com ([10.7.209.65])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 12 Jan 2021 01:39:16 -0800", "from npg-dpdk-cvl-jeffguo-01.sh.intel.com ([10.67.111.128])\n by orsmga008.jf.intel.com with ESMTP; 12 Jan 2021 01:39:13 -0800" ], "IronPort-SDR": [ "\n Zw79MpJEnpcSFu3gjKZmEqEeMqRh1EZBlFLyJgD47Diri9idBPLjegoZuaiQBi8BIIpDi0RH+5\n o1LqDmrJFkbw==", "\n GM/Pu0TOxAj3bkiyKEFLobqgnGtP9DHrMc6K9AosgvuFRV+HLufaOViQtIFoSGyuPpbKRulWqX\n 1cMAaoof/bsg==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9861\"; a=\"239554326\"", "E=Sophos;i=\"5.79,341,1602572400\"; d=\"scan'208\";a=\"239554326\"", "E=Sophos;i=\"5.79,341,1602572400\"; d=\"scan'208\";a=\"381356099\"" ], "X-ExtLoop1": "1", "From": "Jeff Guo <jia.guo@intel.com>", "To": "qi.z.zhang@intel.com, jingjing.wu@intel.com, qiming.yang@intel.com,\n haiyue.wang@intel.com", "Cc": "dev@dpdk.org,\n\tjia.guo@intel.com,\n\tsimei.su@intel.com", "Date": "Tue, 12 Jan 2021 17:32:43 +0800", "Message-Id": "<20210112093243.40840-4-jia.guo@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20210112093243.40840-1-jia.guo@intel.com>", "References": "<20201216085854.7842-1-jia.guo@intel.com>\n <20210112093243.40840-1-jia.guo@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [dpdk-dev v3 3/3] net/ice: refactor PTYPE parsing", "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": "If the capability of a PTYPE within a specific package could be\nnegotiated, no need to maintain a different PTYPE list for each\ntype of the package when parsing PTYPE. So refactor the PTYPE\nparsing mechanism for each flow engines.\n\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\n---\n drivers/net/ice/ice_acl_filter.c | 3 +-\n drivers/net/ice/ice_fdir_filter.c | 63 ++-----------\n drivers/net/ice/ice_generic_flow.c | 132 ++++++++++++++++++++++++--\n drivers/net/ice/ice_generic_flow.h | 9 +-\n drivers/net/ice/ice_hash.c | 47 ++--------\n drivers/net/ice/ice_switch_filter.c | 139 ++++------------------------\n 6 files changed, 165 insertions(+), 228 deletions(-)", "diff": "diff --git a/drivers/net/ice/ice_acl_filter.c b/drivers/net/ice/ice_acl_filter.c\nindex f7dbe53574..363ce68318 100644\n--- a/drivers/net/ice/ice_acl_filter.c\n+++ b/drivers/net/ice/ice_acl_filter.c\n@@ -914,7 +914,8 @@ ice_acl_parse(struct ice_adapter *ad,\n \tint ret;\n \n \tmemset(filter, 0, sizeof(*filter));\n-\titem = ice_search_pattern_match_item(pattern, array, array_len, error);\n+\titem = ice_search_pattern_match_item(ad, pattern, array, array_len,\n+\t\t\t\t\t error);\n \tif (!item)\n \t\treturn -rte_errno;\n \ndiff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c\nindex 175abcdd5c..ce6aa09d3d 100644\n--- a/drivers/net/ice/ice_fdir_filter.c\n+++ b/drivers/net/ice/ice_fdir_filter.c\n@@ -84,34 +84,7 @@\n \tICE_INSET_IPV6_SRC | ICE_INSET_IPV6_DST | \\\n \tICE_INSET_GTPU_TEID | ICE_INSET_GTPU_QFI)\n \n-static struct ice_pattern_match_item ice_fdir_pattern_os[] = {\n-\t{pattern_eth_ipv4, ICE_FDIR_INSET_ETH_IPV4, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp, ICE_FDIR_INSET_ETH_IPV4_UDP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_tcp, ICE_FDIR_INSET_ETH_IPV4_TCP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_sctp, ICE_FDIR_INSET_ETH_IPV4_SCTP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv6, ICE_FDIR_INSET_ETH_IPV6, ICE_INSET_NONE},\n-\t{pattern_eth_ipv6_udp, ICE_FDIR_INSET_ETH_IPV6_UDP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv6_tcp, ICE_FDIR_INSET_ETH_IPV6_TCP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv6_sctp, ICE_FDIR_INSET_ETH_IPV6_SCTP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_ipv4,\n-\t\t\t\t ICE_FDIR_INSET_VXLAN_IPV4, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_ipv4_udp,\n-\t\t\t\t ICE_FDIR_INSET_VXLAN_IPV4_UDP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_ipv4_tcp,\n-\t\t\t\t ICE_FDIR_INSET_VXLAN_IPV4_TCP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_ipv4_sctp,\n-\t\t\t\t ICE_FDIR_INSET_VXLAN_IPV4_SCTP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4,\n-\t\t\t\t ICE_FDIR_INSET_VXLAN_IPV4, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_udp,\n-\t\t\t\t ICE_FDIR_INSET_VXLAN_IPV4_UDP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_tcp,\n-\t\t\t\t ICE_FDIR_INSET_VXLAN_IPV4_TCP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_sctp,\n-\t\t\t\t ICE_FDIR_INSET_VXLAN_IPV4_SCTP, ICE_INSET_NONE},\n-};\n-\n-static struct ice_pattern_match_item ice_fdir_pattern_comms[] = {\n+static struct ice_pattern_match_item ice_fdir_pattern_list[] = {\n \t{pattern_ethertype,\t ICE_FDIR_INSET_ETH,\t\t ICE_INSET_NONE},\n \t{pattern_eth_ipv4, ICE_FDIR_INSET_ETH_IPV4, ICE_INSET_NONE},\n \t{pattern_eth_ipv4_udp, ICE_FDIR_INSET_ETH_IPV4_UDP, ICE_INSET_NONE},\n@@ -143,8 +116,7 @@ static struct ice_pattern_match_item ice_fdir_pattern_comms[] = {\n \t{pattern_eth_ipv6_gtpu_eh, ICE_FDIR_INSET_IPV6_GTPU_EH, ICE_INSET_NONE},\n };\n \n-static struct ice_flow_parser ice_fdir_parser_os;\n-static struct ice_flow_parser ice_fdir_parser_comms;\n+static struct ice_flow_parser ice_fdir_parser;\n \n static int\n ice_fdir_is_tunnel_profile(enum ice_fdir_tunnel_type tunnel_type);\n@@ -1111,12 +1083,7 @@ ice_fdir_init(struct ice_adapter *ad)\n \tif (ret)\n \t\treturn ret;\n \n-\tif (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n-\t\tparser = &ice_fdir_parser_comms;\n-\telse if (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT)\n-\t\tparser = &ice_fdir_parser_os;\n-\telse\n-\t\treturn -EINVAL;\n+\tparser = &ice_fdir_parser;\n \n \treturn ice_register_parser(parser, ad);\n }\n@@ -1124,16 +1091,13 @@ ice_fdir_init(struct ice_adapter *ad)\n static void\n ice_fdir_uninit(struct ice_adapter *ad)\n {\n-\tstruct ice_pf *pf = &ad->pf;\n \tstruct ice_flow_parser *parser;\n+\tstruct ice_pf *pf = &ad->pf;\n \n \tif (ad->hw.dcf_enabled)\n \t\treturn;\n \n-\tif (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n-\t\tparser = &ice_fdir_parser_comms;\n-\telse\n-\t\tparser = &ice_fdir_parser_os;\n+\tparser = &ice_fdir_parser;\n \n \tice_unregister_parser(parser, ad);\n \n@@ -2039,7 +2003,8 @@ ice_fdir_parse(struct ice_adapter *ad,\n \tint ret;\n \n \tmemset(filter, 0, sizeof(*filter));\n-\titem = ice_search_pattern_match_item(pattern, array, array_len, error);\n+\titem = ice_search_pattern_match_item(ad, pattern, array, array_len,\n+\t\t\t\t\t error);\n \tif (!item)\n \t\treturn -rte_errno;\n \n@@ -2067,18 +2032,10 @@ ice_fdir_parse(struct ice_adapter *ad,\n \treturn ret;\n }\n \n-static struct ice_flow_parser ice_fdir_parser_os = {\n-\t.engine = &ice_fdir_engine,\n-\t.array = ice_fdir_pattern_os,\n-\t.array_len = RTE_DIM(ice_fdir_pattern_os),\n-\t.parse_pattern_action = ice_fdir_parse,\n-\t.stage = ICE_FLOW_STAGE_DISTRIBUTOR,\n-};\n-\n-static struct ice_flow_parser ice_fdir_parser_comms = {\n+static struct ice_flow_parser ice_fdir_parser = {\n \t.engine = &ice_fdir_engine,\n-\t.array = ice_fdir_pattern_comms,\n-\t.array_len = RTE_DIM(ice_fdir_pattern_comms),\n+\t.array = ice_fdir_pattern_list,\n+\t.array_len = RTE_DIM(ice_fdir_pattern_list),\n \t.parse_pattern_action = ice_fdir_parse,\n \t.stage = ICE_FLOW_STAGE_DISTRIBUTOR,\n };\ndiff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c\nindex 1429cbc3b6..4313aae183 100644\n--- a/drivers/net/ice/ice_generic_flow.c\n+++ b/drivers/net/ice/ice_generic_flow.c\n@@ -2046,17 +2046,127 @@ ice_match_pattern(enum rte_flow_item_type *item_array,\n \t\titem->type == RTE_FLOW_ITEM_TYPE_END);\n }\n \n+struct ice_ptype_match {\n+\tenum rte_flow_item_type *pattern_list;\n+\tuint16_t hw_ptype;\n+};\n+\n+static struct ice_ptype_match ice_ptype_map[] = {\n+\t{pattern_eth_ipv4,\t\t\t\tICE_PTYPE_IPV4_PAY},\n+\t{pattern_eth_ipv4_udp,\t\t\t\tICE_PTYPE_IPV4_UDP_PAY},\n+\t{pattern_eth_ipv4_tcp,\t\t\t\tICE_PTYPE_IPV4_TCP_PAY},\n+\t{pattern_eth_ipv4_sctp,\t\t\t\tICE_PTYPE_IPV4_SCTP_PAY},\n+\t{pattern_eth_ipv4_gtpu,\t\t\t\tICE_MAC_IPV4_GTPU},\n+\t{pattern_eth_ipv4_gtpu_eh,\t\t\tICE_MAC_IPV4_GTPU},\n+\t{pattern_eth_ipv4_gtpu_ipv4,\t\t\tICE_MAC_IPV4_GTPU_IPV4_PAY},\n+\t{pattern_eth_ipv4_gtpu_ipv4_udp,\t\tICE_MAC_IPV4_GTPU_IPV4_UDP_PAY},\n+\t{pattern_eth_ipv4_gtpu_ipv4_tcp,\t\tICE_MAC_IPV4_GTPU_IPV4_TCP},\n+\t{pattern_eth_ipv4_gtpu_ipv6,\t\t\tICE_MAC_IPV4_GTPU_IPV6_PAY},\n+\t{pattern_eth_ipv4_gtpu_ipv6_udp,\t\tICE_MAC_IPV4_GTPU_IPV6_UDP_PAY},\n+\t{pattern_eth_ipv4_gtpu_ipv6_tcp,\t\tICE_MAC_IPV4_GTPU_IPV6_TCP},\n+\t{pattern_eth_ipv4_gtpu_eh_ipv4,\t\t\tICE_MAC_IPV4_GTPU_IPV4_PAY},\n+\t{pattern_eth_ipv4_gtpu_eh_ipv4_udp,\t\tICE_MAC_IPV4_GTPU_IPV4_UDP_PAY},\n+\t{pattern_eth_ipv4_gtpu_eh_ipv4_tcp,\t\tICE_MAC_IPV4_GTPU_IPV4_TCP},\n+\t{pattern_eth_ipv4_gtpu_eh_ipv6,\t\t\tICE_MAC_IPV4_GTPU_IPV6_PAY},\n+\t{pattern_eth_ipv4_gtpu_eh_ipv6_udp,\t\tICE_MAC_IPV4_GTPU_IPV6_UDP_PAY},\n+\t{pattern_eth_ipv4_gtpu_eh_ipv6_tcp,\t\tICE_MAC_IPV4_GTPU_IPV6_TCP},\n+\t{pattern_eth_ipv4_esp,\t\t\t\tICE_MAC_IPV4_ESP},\n+\t{pattern_eth_ipv4_udp_esp,\t\t\tICE_MAC_IPV4_NAT_T_ESP},\n+\t{pattern_eth_ipv4_ah,\t\t\t\tICE_MAC_IPV4_AH},\n+\t{pattern_eth_ipv4_l2tp,\t\t\t\tICE_MAC_IPV4_L2TPV3},\n+\t{pattern_eth_ipv4_pfcp,\t\t\t\tICE_MAC_IPV4_PFCP_SESSION},\n+\t{pattern_eth_ipv6,\t\t\t\tICE_PTYPE_IPV6_PAY},\n+\t{pattern_eth_ipv6_udp,\t\t\t\tICE_PTYPE_IPV6_UDP_PAY},\n+\t{pattern_eth_ipv6_tcp,\t\t\t\tICE_PTYPE_IPV6_TCP_PAY},\n+\t{pattern_eth_ipv6_sctp,\t\t\t\tICE_PTYPE_IPV6_SCTP_PAY},\n+\t{pattern_eth_ipv6_gtpu,\t\t\t\tICE_MAC_IPV6_GTPU},\n+\t{pattern_eth_ipv6_gtpu_eh,\t\t\tICE_MAC_IPV6_GTPU},\n+\t{pattern_eth_ipv6_gtpu_ipv4,\t\t\tICE_MAC_IPV6_GTPU_IPV4_PAY},\n+\t{pattern_eth_ipv6_gtpu_ipv4_udp,\t\tICE_MAC_IPV6_GTPU_IPV4_UDP_PAY},\n+\t{pattern_eth_ipv6_gtpu_ipv4_tcp,\t\tICE_MAC_IPV6_GTPU_IPV4_TCP},\n+\t{pattern_eth_ipv6_gtpu_ipv6,\t\t\tICE_MAC_IPV6_GTPU_IPV6_PAY},\n+\t{pattern_eth_ipv6_gtpu_ipv6_udp,\t\tICE_MAC_IPV6_GTPU_IPV6_UDP_PAY},\n+\t{pattern_eth_ipv6_gtpu_ipv6_tcp,\t\tICE_MAC_IPV6_GTPU_IPV6_TCP},\n+\t{pattern_eth_ipv6_gtpu_eh_ipv4,\t\t\tICE_MAC_IPV6_GTPU_IPV4_PAY},\n+\t{pattern_eth_ipv6_gtpu_eh_ipv4_udp,\t\tICE_MAC_IPV6_GTPU_IPV4_UDP_PAY},\n+\t{pattern_eth_ipv6_gtpu_eh_ipv4_tcp,\t\tICE_MAC_IPV6_GTPU_IPV4_TCP},\n+\t{pattern_eth_ipv6_gtpu_eh_ipv6,\t\t\tICE_MAC_IPV6_GTPU_IPV6_PAY},\n+\t{pattern_eth_ipv6_gtpu_eh_ipv6_udp,\t\tICE_MAC_IPV6_GTPU_IPV6_UDP_PAY},\n+\t{pattern_eth_ipv6_gtpu_eh_ipv6_tcp,\t\tICE_MAC_IPV6_GTPU_IPV6_TCP},\n+\t{pattern_eth_ipv6_esp,\t\t\t\tICE_MAC_IPV6_ESP},\n+\t{pattern_eth_ipv6_udp_esp,\t\t\tICE_MAC_IPV6_NAT_T_ESP},\n+\t{pattern_eth_ipv6_ah,\t\t\t\tICE_MAC_IPV6_AH},\n+\t{pattern_eth_ipv6_l2tp,\t\t\t\tICE_MAC_IPV6_L2TPV3},\n+\t{pattern_eth_ipv6_pfcp,\t\t\t\tICE_MAC_IPV6_PFCP_SESSION},\n+\t{pattern_ethertype,\t\t\t\tICE_PTYPE_MAC_PAY},\n+\t{pattern_ethertype_vlan,\t\t\tICE_PTYPE_MAC_PAY},\n+\t{pattern_eth_arp,\t\t\t\tICE_PTYPE_MAC_PAY},\n+\t{pattern_eth_vlan_ipv4,\t\t\t\tICE_PTYPE_IPV4_PAY},\n+\t{pattern_eth_vlan_ipv4_udp,\t\t\tICE_PTYPE_IPV4_UDP_PAY},\n+\t{pattern_eth_vlan_ipv4_tcp,\t\t\tICE_PTYPE_IPV4_TCP_PAY},\n+\t{pattern_eth_vlan_ipv4_sctp,\t\t\tICE_PTYPE_IPV4_SCTP_PAY},\n+\t{pattern_eth_vlan_ipv6,\t\t\t\tICE_PTYPE_IPV6_PAY},\n+\t{pattern_eth_vlan_ipv6_udp,\t\t\tICE_PTYPE_IPV6_UDP_PAY},\n+\t{pattern_eth_vlan_ipv6_tcp,\t\t\tICE_PTYPE_IPV6_TCP_PAY},\n+\t{pattern_eth_vlan_ipv6_sctp,\t\t\tICE_PTYPE_IPV6_SCTP_PAY},\n+\t{pattern_eth_pppoes,\t\t\t\tICE_MAC_PPPOE_PAY},\n+\t{pattern_eth_vlan_pppoes,\t\t\tICE_MAC_PPPOE_PAY},\n+\t{pattern_eth_pppoes_proto,\t\t\tICE_MAC_PPPOE_PAY},\n+\t{pattern_eth_vlan_pppoes_proto,\t\t\tICE_MAC_PPPOE_PAY},\n+\t{pattern_eth_pppoes_ipv4,\t\t\tICE_MAC_PPPOE_IPV4_PAY},\n+\t{pattern_eth_pppoes_ipv4_udp,\t\t\tICE_MAC_PPPOE_IPV4_UDP_PAY},\n+\t{pattern_eth_pppoes_ipv4_tcp,\t\t\tICE_MAC_PPPOE_IPV4_TCP},\n+\t{pattern_eth_vlan_pppoes_ipv4,\t\t\tICE_MAC_PPPOE_IPV4_PAY},\n+\t{pattern_eth_vlan_pppoes_ipv4_tcp,\t\tICE_MAC_PPPOE_IPV4_TCP},\n+\t{pattern_eth_vlan_pppoes_ipv4_udp,\t\tICE_MAC_PPPOE_IPV4_UDP_PAY},\n+\t{pattern_eth_pppoes_ipv6,\t\t\tICE_MAC_PPPOE_IPV6_PAY},\n+\t{pattern_eth_pppoes_ipv6_udp,\t\t\tICE_MAC_PPPOE_IPV6_UDP_PAY},\n+\t{pattern_eth_pppoes_ipv6_tcp,\t\t\tICE_MAC_PPPOE_IPV6_TCP},\n+\t{pattern_eth_vlan_pppoes_ipv6,\t\t\tICE_MAC_PPPOE_IPV6_PAY},\n+\t{pattern_eth_vlan_pppoes_ipv6_tcp,\t\tICE_MAC_PPPOE_IPV6_TCP},\n+\t{pattern_eth_vlan_pppoes_ipv6_udp,\t\tICE_MAC_PPPOE_IPV6_UDP_PAY},\n+\t{pattern_eth_ipv4_udp_vxlan_ipv4,\t\tICE_MAC_IPV4_TUN_IPV4_PAY},\n+\t{pattern_eth_ipv4_udp_vxlan_ipv4_udp,\t\tICE_MAC_IPV4_TUN_IPV4_UDP_PAY},\n+\t{pattern_eth_ipv4_udp_vxlan_ipv4_tcp,\t\tICE_MAC_IPV4_TUN_IPV4_TCP},\n+\t{pattern_eth_ipv4_udp_vxlan_ipv4_sctp,\t\tICE_MAC_IPV4_TUN_IPV4_SCTP},\n+\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4,\t\tICE_MAC_IPV4_TUN_IPV4_PAY},\n+\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_udp,\tICE_MAC_IPV4_TUN_IPV4_UDP_PAY},\n+\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_tcp,\tICE_MAC_IPV4_TUN_IPV4_TCP},\n+\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_sctp,\tICE_MAC_IPV4_TUN_IPV4_SCTP},\n+\t{pattern_eth_ipv4_nvgre_eth_ipv4,\t\tICE_MAC_IPV4_TUN_IPV4_PAY},\n+\t{pattern_eth_ipv4_nvgre_eth_ipv4_udp,\t\tICE_MAC_IPV4_TUN_IPV4_UDP_PAY},\n+\t{pattern_eth_ipv4_nvgre_eth_ipv4_tcp,\t\tICE_MAC_IPV4_TUN_IPV4_TCP},\n+};\n+\n+static bool\n+ice_pattern_is_supported(__rte_unused struct ice_adapter *ad,\n+\t\t\t const struct rte_flow_item *pattern)\n+{\n+\tuint16_t i;\n+\n+\tfor (i = 0; i < RTE_DIM(ice_ptype_map); i++) {\n+\t\tif (ice_match_pattern(ice_ptype_map[i].pattern_list,\n+\t\t\t\t pattern)) {\n+\t\t\treturn ice_hw_ptype_ena(&ad->hw,\n+\t\t\t\t\t\tice_ptype_map[i].hw_ptype);\n+\t\t}\n+\t}\n+\n+\treturn false;\n+}\n+\n struct ice_pattern_match_item *\n-ice_search_pattern_match_item(const struct rte_flow_item pattern[],\n-\t\tstruct ice_pattern_match_item *array,\n-\t\tuint32_t array_len,\n-\t\tstruct rte_flow_error *error)\n+ice_search_pattern_match_item(struct ice_adapter *ad,\n+\t\t\t const struct rte_flow_item pattern[],\n+\t\t\t struct ice_pattern_match_item *array,\n+\t\t\t uint32_t array_len,\n+\t\t\t struct rte_flow_error *error)\n {\n-\tuint16_t i = 0;\n \tstruct ice_pattern_match_item *pattern_match_item;\n \t/* need free by each filter */\n \tstruct rte_flow_item *items; /* used for pattern without VOID items */\n \tuint32_t item_num = 0; /* non-void item number */\n+\tuint16_t i = 0;\n \n \t/* Get the non-void item number of pattern */\n \twhile ((pattern + i)->type != RTE_FLOW_ITEM_TYPE_END) {\n@@ -2078,14 +2188,18 @@ ice_search_pattern_match_item(const struct rte_flow_item pattern[],\n \tif (!pattern_match_item) {\n \t\trte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE,\n \t\t\t\tNULL, \"Failed to allocate memory.\");\n+\t\trte_free(items);\n \t\treturn NULL;\n \t}\n \n \tice_pattern_skip_void_item(items, pattern);\n \n-\tfor (i = 0; i < array_len; i++)\n+\tif (!ice_pattern_is_supported(ad, pattern))\n+\t\tgoto unsupported;\n+\n+\tfor (i = 0; i < array_len; i++) {\n \t\tif (ice_match_pattern(array[i].pattern_list,\n-\t\t\t\t\titems)) {\n+\t\t\t\t items)) {\n \t\t\tpattern_match_item->input_set_mask =\n \t\t\t\tarray[i].input_set_mask;\n \t\t\tpattern_match_item->pattern_list =\n@@ -2094,9 +2208,11 @@ ice_search_pattern_match_item(const struct rte_flow_item pattern[],\n \t\t\trte_free(items);\n \t\t\treturn pattern_match_item;\n \t\t}\n+\t}\n+\n+unsupported:\n \trte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,\n \t\t\t pattern, \"Unsupported pattern\");\n-\n \trte_free(items);\n \trte_free(pattern_match_item);\n \treturn NULL;\ndiff --git a/drivers/net/ice/ice_generic_flow.h b/drivers/net/ice/ice_generic_flow.h\nindex 434d2f425d..0dcb620809 100644\n--- a/drivers/net/ice/ice_generic_flow.h\n+++ b/drivers/net/ice/ice_generic_flow.h\n@@ -593,10 +593,11 @@ int ice_register_parser(struct ice_flow_parser *parser,\n void ice_unregister_parser(struct ice_flow_parser *parser,\n \t\tstruct ice_adapter *ad);\n struct ice_pattern_match_item *\n-ice_search_pattern_match_item(const struct rte_flow_item pattern[],\n-\t\tstruct ice_pattern_match_item *array,\n-\t\tuint32_t array_len,\n-\t\tstruct rte_flow_error *error);\n+ice_search_pattern_match_item(struct ice_adapter *ad,\n+\t\t\t const struct rte_flow_item pattern[],\n+\t\t\t struct ice_pattern_match_item *array,\n+\t\t\t uint32_t array_len,\n+\t\t\t struct rte_flow_error *error);\n int\n ice_flow_redirect(struct ice_adapter *ad,\n \t\t struct ice_flow_redirect *rd);\ndiff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c\nindex fe3e06c579..fab2d397b7 100644\n--- a/drivers/net/ice/ice_hash.c\n+++ b/drivers/net/ice/ice_hash.c\n@@ -313,21 +313,7 @@ struct rss_type_match_hdr hint_eth_pppoes = {\n \tICE_FLOW_SEG_HDR_PPPOE,\n \tETH_RSS_ETH | ETH_RSS_PPPOE};\n \n-/* Supported pattern for os default package. */\n-static struct ice_pattern_match_item ice_hash_pattern_list_os[] = {\n-\t{pattern_eth_ipv4,\tICE_INSET_NONE,\t&hint_eth_ipv4},\n-\t{pattern_eth_ipv4_udp,\tICE_INSET_NONE,\t&hint_eth_ipv4_udp},\n-\t{pattern_eth_ipv4_tcp,\tICE_INSET_NONE,\t&hint_eth_ipv4_tcp},\n-\t{pattern_eth_ipv4_sctp,\tICE_INSET_NONE,\t&hint_eth_ipv4_sctp},\n-\t{pattern_eth_ipv6,\tICE_INSET_NONE,\t&hint_eth_ipv6},\n-\t{pattern_eth_ipv6_udp,\tICE_INSET_NONE,\t&hint_eth_ipv6_udp},\n-\t{pattern_eth_ipv6_tcp,\tICE_INSET_NONE,\t&hint_eth_ipv6_tcp},\n-\t{pattern_eth_ipv6_sctp,\tICE_INSET_NONE,\t&hint_eth_ipv6_sctp},\n-\t{pattern_empty,\t\tICE_INSET_NONE,\t&hint_empty},\n-};\n-\n-/* Supported pattern for comms package. */\n-static struct ice_pattern_match_item ice_hash_pattern_list_comms[] = {\n+static struct ice_pattern_match_item ice_hash_pattern_list[] = {\n \t{pattern_empty,\t\t\t ICE_INSET_NONE,\n \t\t&hint_empty},\n \t{pattern_eth_ipv4,\t\t ICE_INSET_NONE,\n@@ -915,19 +901,10 @@ static struct ice_flow_engine ice_hash_engine = {\n };\n \n /* Register parser for os package. */\n-static struct ice_flow_parser ice_hash_parser_os = {\n-\t.engine = &ice_hash_engine,\n-\t.array = ice_hash_pattern_list_os,\n-\t.array_len = RTE_DIM(ice_hash_pattern_list_os),\n-\t.parse_pattern_action = ice_hash_parse_pattern_action,\n-\t.stage = ICE_FLOW_STAGE_RSS,\n-};\n-\n-/* Register parser for comms package. */\n-static struct ice_flow_parser ice_hash_parser_comms = {\n+static struct ice_flow_parser ice_hash_parser = {\n \t.engine = &ice_hash_engine,\n-\t.array = ice_hash_pattern_list_comms,\n-\t.array_len = RTE_DIM(ice_hash_pattern_list_comms),\n+\t.array = ice_hash_pattern_list,\n+\t.array_len = RTE_DIM(ice_hash_pattern_list),\n \t.parse_pattern_action = ice_hash_parse_pattern_action,\n \t.stage = ICE_FLOW_STAGE_RSS,\n };\n@@ -946,12 +923,7 @@ ice_hash_init(struct ice_adapter *ad)\n \tif (ad->hw.dcf_enabled)\n \t\treturn 0;\n \n-\tif (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT)\n-\t\tparser = &ice_hash_parser_os;\n-\telse if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n-\t\tparser = &ice_hash_parser_comms;\n-\telse\n-\t\treturn -EINVAL;\n+\tparser = &ice_hash_parser;\n \n \treturn ice_register_parser(parser, ad);\n }\n@@ -1211,8 +1183,8 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad,\n \t}\n \n \t/* Check rss supported pattern and find matched pattern. */\n-\tpattern_match_item = ice_search_pattern_match_item(pattern,\n-\t\t\t\t\tarray, array_len, error);\n+\tpattern_match_item = ice_search_pattern_match_item(ad, pattern, array,\n+\t\t\t\t\t\t\t array_len, error);\n \tif (!pattern_match_item) {\n \t\tret = -rte_errno;\n \t\tgoto error;\n@@ -1352,10 +1324,7 @@ ice_hash_uninit(struct ice_adapter *ad)\n \tif (ad->hw.dcf_enabled)\n \t\treturn;\n \n-\tif (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT)\n-\t\tice_unregister_parser(&ice_hash_parser_os, ad);\n-\telse if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n-\t\tice_unregister_parser(&ice_hash_parser_comms, ad);\n+\tice_unregister_parser(&ice_hash_parser, ad);\n }\n \n static void\ndiff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c\nindex 8cba6eb7b1..e5b7d56068 100644\n--- a/drivers/net/ice/ice_switch_filter.c\n+++ b/drivers/net/ice/ice_switch_filter.c\n@@ -137,47 +137,11 @@ struct sw_meta {\n \tstruct ice_adv_rule_info rule_info;\n };\n \n-static struct ice_flow_parser ice_switch_dist_parser_os;\n-static struct ice_flow_parser ice_switch_dist_parser_comms;\n-static struct ice_flow_parser ice_switch_perm_parser_os;\n-static struct ice_flow_parser ice_switch_perm_parser_comms;\n+static struct ice_flow_parser ice_switch_dist_parser;\n+static struct ice_flow_parser ice_switch_perm_parser;\n \n static struct\n-ice_pattern_match_item ice_switch_pattern_dist_os[] = {\n-\t{pattern_ethertype,\n-\t\t\tICE_SW_INSET_ETHER, ICE_INSET_NONE},\n-\t{pattern_ethertype_vlan,\n-\t\t\tICE_SW_INSET_MAC_VLAN, ICE_INSET_NONE},\n-\t{pattern_eth_arp,\n-\t\t\tICE_INSET_NONE, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4,\n-\t\t\tICE_SW_INSET_MAC_IPV4, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp,\n-\t\t\tICE_SW_INSET_MAC_IPV4_UDP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_tcp,\n-\t\t\tICE_SW_INSET_MAC_IPV4_TCP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv6,\n-\t\t\tICE_SW_INSET_MAC_IPV6, ICE_INSET_NONE},\n-\t{pattern_eth_ipv6_udp,\n-\t\t\tICE_SW_INSET_MAC_IPV6_UDP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv6_tcp,\n-\t\t\tICE_SW_INSET_MAC_IPV6_TCP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4,\n-\t\t\tICE_SW_INSET_DIST_VXLAN_IPV4, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_udp,\n-\t\t\tICE_SW_INSET_DIST_VXLAN_IPV4_UDP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_tcp,\n-\t\t\tICE_SW_INSET_DIST_VXLAN_IPV4_TCP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_nvgre_eth_ipv4,\n-\t\t\tICE_SW_INSET_DIST_NVGRE_IPV4, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_nvgre_eth_ipv4_udp,\n-\t\t\tICE_SW_INSET_DIST_NVGRE_IPV4_UDP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_nvgre_eth_ipv4_tcp,\n-\t\t\tICE_SW_INSET_DIST_NVGRE_IPV4_TCP, ICE_INSET_NONE},\n-};\n-\n-static struct\n-ice_pattern_match_item ice_switch_pattern_dist_comms[] = {\n+ice_pattern_match_item ice_switch_pattern_dist_list[] = {\n \t{pattern_ethertype,\n \t\t\tICE_SW_INSET_ETHER, ICE_INSET_NONE},\n \t{pattern_ethertype_vlan,\n@@ -265,41 +229,7 @@ ice_pattern_match_item ice_switch_pattern_dist_comms[] = {\n };\n \n static struct\n-ice_pattern_match_item ice_switch_pattern_perm_os[] = {\n-\t{pattern_ethertype,\n-\t\t\tICE_SW_INSET_ETHER, ICE_INSET_NONE},\n-\t{pattern_ethertype_vlan,\n-\t\t\tICE_SW_INSET_MAC_VLAN, ICE_INSET_NONE},\n-\t{pattern_eth_arp,\n-\t\t\tICE_INSET_NONE, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4,\n-\t\t\tICE_SW_INSET_MAC_IPV4, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp,\n-\t\t\tICE_SW_INSET_MAC_IPV4_UDP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_tcp,\n-\t\t\tICE_SW_INSET_MAC_IPV4_TCP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv6,\n-\t\t\tICE_SW_INSET_MAC_IPV6, ICE_INSET_NONE},\n-\t{pattern_eth_ipv6_udp,\n-\t\t\tICE_SW_INSET_MAC_IPV6_UDP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv6_tcp,\n-\t\t\tICE_SW_INSET_MAC_IPV6_TCP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4,\n-\t\t\tICE_SW_INSET_PERM_TUNNEL_IPV4, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_udp,\n-\t\t\tICE_SW_INSET_PERM_TUNNEL_IPV4_UDP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_tcp,\n-\t\t\tICE_SW_INSET_PERM_TUNNEL_IPV4_TCP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_nvgre_eth_ipv4,\n-\t\t\tICE_SW_INSET_PERM_TUNNEL_IPV4, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_nvgre_eth_ipv4_udp,\n-\t\t\tICE_SW_INSET_PERM_TUNNEL_IPV4_UDP, ICE_INSET_NONE},\n-\t{pattern_eth_ipv4_nvgre_eth_ipv4_tcp,\n-\t\t\tICE_SW_INSET_PERM_TUNNEL_IPV4_TCP, ICE_INSET_NONE},\n-};\n-\n-static struct\n-ice_pattern_match_item ice_switch_pattern_perm_comms[] = {\n+ice_pattern_match_item ice_switch_pattern_perm_list[] = {\n \t{pattern_ethertype,\n \t\t\tICE_SW_INSET_ETHER, ICE_INSET_NONE},\n \t{pattern_ethertype_vlan,\n@@ -1699,7 +1629,8 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad,\n \t}\n \n \tpattern_match_item =\n-\t\tice_search_pattern_match_item(pattern, array, array_len, error);\n+\t\tice_search_pattern_match_item(ad, pattern, array, array_len,\n+\t\t\t\t\t error);\n \tif (!pattern_match_item) {\n \t\trte_flow_error_set(error, EINVAL,\n \t\t\t\t RTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n@@ -1859,21 +1790,11 @@ ice_switch_init(struct ice_adapter *ad)\n \tstruct ice_flow_parser *dist_parser;\n \tstruct ice_flow_parser *perm_parser;\n \n-\tif (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n-\t\tdist_parser = &ice_switch_dist_parser_comms;\n-\telse if (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT)\n-\t\tdist_parser = &ice_switch_dist_parser_os;\n-\telse\n-\t\treturn -EINVAL;\n-\n \tif (ad->devargs.pipe_mode_support) {\n-\t\tif (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n-\t\t\tperm_parser = &ice_switch_perm_parser_comms;\n-\t\telse\n-\t\t\tperm_parser = &ice_switch_perm_parser_os;\n-\n+\t\tperm_parser = &ice_switch_perm_parser;\n \t\tret = ice_register_parser(perm_parser, ad);\n \t} else {\n+\t\tdist_parser = &ice_switch_dist_parser;\n \t\tret = ice_register_parser(dist_parser, ad);\n \t}\n \treturn ret;\n@@ -1885,21 +1806,11 @@ ice_switch_uninit(struct ice_adapter *ad)\n \tstruct ice_flow_parser *dist_parser;\n \tstruct ice_flow_parser *perm_parser;\n \n-\tif (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n-\t\tdist_parser = &ice_switch_dist_parser_comms;\n-\telse if (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT)\n-\t\tdist_parser = &ice_switch_dist_parser_os;\n-\telse\n-\t\treturn;\n-\n \tif (ad->devargs.pipe_mode_support) {\n-\t\tif (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n-\t\t\tperm_parser = &ice_switch_perm_parser_comms;\n-\t\telse\n-\t\t\tperm_parser = &ice_switch_perm_parser_os;\n-\n+\t\tperm_parser = &ice_switch_perm_parser;\n \t\tice_unregister_parser(perm_parser, ad);\n \t} else {\n+\t\tdist_parser = &ice_switch_dist_parser;\n \t\tice_unregister_parser(dist_parser, ad);\n \t}\n }\n@@ -1917,37 +1828,19 @@ ice_flow_engine ice_switch_engine = {\n };\n \n static struct\n-ice_flow_parser ice_switch_dist_parser_os = {\n+ice_flow_parser ice_switch_dist_parser = {\n \t.engine = &ice_switch_engine,\n-\t.array = ice_switch_pattern_dist_os,\n-\t.array_len = RTE_DIM(ice_switch_pattern_dist_os),\n+\t.array = ice_switch_pattern_dist_list,\n+\t.array_len = RTE_DIM(ice_switch_pattern_dist_list),\n \t.parse_pattern_action = ice_switch_parse_pattern_action,\n \t.stage = ICE_FLOW_STAGE_DISTRIBUTOR,\n };\n \n static struct\n-ice_flow_parser ice_switch_dist_parser_comms = {\n-\t.engine = &ice_switch_engine,\n-\t.array = ice_switch_pattern_dist_comms,\n-\t.array_len = RTE_DIM(ice_switch_pattern_dist_comms),\n-\t.parse_pattern_action = ice_switch_parse_pattern_action,\n-\t.stage = ICE_FLOW_STAGE_DISTRIBUTOR,\n-};\n-\n-static struct\n-ice_flow_parser ice_switch_perm_parser_os = {\n-\t.engine = &ice_switch_engine,\n-\t.array = ice_switch_pattern_perm_os,\n-\t.array_len = RTE_DIM(ice_switch_pattern_perm_os),\n-\t.parse_pattern_action = ice_switch_parse_pattern_action,\n-\t.stage = ICE_FLOW_STAGE_PERMISSION,\n-};\n-\n-static struct\n-ice_flow_parser ice_switch_perm_parser_comms = {\n+ice_flow_parser ice_switch_perm_parser = {\n \t.engine = &ice_switch_engine,\n-\t.array = ice_switch_pattern_perm_comms,\n-\t.array_len = RTE_DIM(ice_switch_pattern_perm_comms),\n+\t.array = ice_switch_pattern_perm_list,\n+\t.array_len = RTE_DIM(ice_switch_pattern_perm_list),\n \t.parse_pattern_action = ice_switch_parse_pattern_action,\n \t.stage = ICE_FLOW_STAGE_PERMISSION,\n };\n", "prefixes": [ "v3", "3/3" ] }{ "id": 86394, "url": "