get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 89316,
    "url": "http://patchwork.dpdk.org/api/patches/89316/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210317031211.18145-5-jia.guo@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20210317031211.18145-5-jia.guo@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210317031211.18145-5-jia.guo@intel.com",
    "date": "2021-03-17T03:12:11",
    "name": "[v1,4/4] net/iavf: support FDIR for IP fragment packet",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a9d2486cc5755e24c215c2484aee9776c13ad322",
    "submitter": {
        "id": 507,
        "url": "http://patchwork.dpdk.org/api/people/507/?format=api",
        "name": "Guo, Jia",
        "email": "jia.guo@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patchwork.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210317031211.18145-5-jia.guo@intel.com/mbox/",
    "series": [
        {
            "id": 15717,
            "url": "http://patchwork.dpdk.org/api/series/15717/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=15717",
            "date": "2021-03-17T03:12:07",
            "name": "support flow for IP fragment in IAVF",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/15717/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/89316/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/89316/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 38193A054F;\n\tWed, 17 Mar 2021 04:19:13 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0711A242AB9;\n\tWed, 17 Mar 2021 04:18:52 +0100 (CET)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id D2A15242AA4\n for <dev@dpdk.org>; Wed, 17 Mar 2021 04:18:49 +0100 (CET)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 16 Mar 2021 20:18:49 -0700",
            "from npg-dpdk-cvl-jeffguo-01.sh.intel.com ([10.67.111.128])\n by fmsmga005.fm.intel.com with ESMTP; 16 Mar 2021 20:18:46 -0700"
        ],
        "IronPort-SDR": [
            "\n QguM8tu1bx7O03klxrhYmkHx/pL97Pv8ZIrOIceoSimtlcrwo++tprNaA9dnGNjvmzDk5/imGT\n j/9Z4bBhjXAw==",
            "\n VSat/fxnhVPta4FGclK75vmCRS50kK9WwLWBJP4q5/WANmU9T2cRP8AbVu2abbBc/GNKRMAcIk\n 5UU2z1d4/E6w=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9925\"; a=\"187005472\"",
            "E=Sophos;i=\"5.81,254,1610438400\"; d=\"scan'208\";a=\"187005472\"",
            "E=Sophos;i=\"5.81,254,1610438400\"; d=\"scan'208\";a=\"605523417\""
        ],
        "X-ExtLoop1": "1",
        "From": "Jeff Guo <jia.guo@intel.com>",
        "To": "orika@nvidia.com, qi.z.zhang@intel.com, beilei.xing@intel.com,\n xiaoyun.li@intel.com, jingjing.wu@intel.com",
        "Cc": "yuying.zhang@intel.com, ting.xu@intel.com, dev@dpdk.org, jia.guo@intel.com",
        "Date": "Wed, 17 Mar 2021 11:12:11 +0800",
        "Message-Id": "<20210317031211.18145-5-jia.guo@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20210317031211.18145-1-jia.guo@intel.com>",
        "References": "<20210317031211.18145-1-jia.guo@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v1 4/4] net/iavf: support FDIR for IP fragment\n packet",
        "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": "New FDIR parsing are added to handle the fragmented IPv4/IPv6 packet.\n\nSigned-off-by: Ting Xu <ting.xu@intel.com>\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\n---\n drivers/net/iavf/iavf_fdir.c         | 278 ++++++++++++++++++---------\n drivers/net/iavf/iavf_generic_flow.h |   5 +\n 2 files changed, 190 insertions(+), 93 deletions(-)",
    "diff": "diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c\nindex e3f3b5f22a..348d423081 100644\n--- a/drivers/net/iavf/iavf_fdir.c\n+++ b/drivers/net/iavf/iavf_fdir.c\n@@ -34,7 +34,7 @@\n #define IAVF_FDIR_INSET_ETH_IPV4 (\\\n \tIAVF_INSET_IPV4_SRC | IAVF_INSET_IPV4_DST | \\\n \tIAVF_INSET_IPV4_PROTO | IAVF_INSET_IPV4_TOS | \\\n-\tIAVF_INSET_IPV4_TTL)\n+\tIAVF_INSET_IPV4_TTL | IAVF_INSET_IPV4_ID)\n \n #define IAVF_FDIR_INSET_ETH_IPV4_UDP (\\\n \tIAVF_INSET_IPV4_SRC | IAVF_INSET_IPV4_DST | \\\n@@ -56,6 +56,9 @@\n \tIAVF_INSET_IPV6_NEXT_HDR | IAVF_INSET_IPV6_TC | \\\n \tIAVF_INSET_IPV6_HOP_LIMIT)\n \n+#define IAVF_FDIR_INSET_ETH_IPV6_FRAG_EXT (\\\n+\tIAVF_INSET_IPV6_ID)\n+\n #define IAVF_FDIR_INSET_ETH_IPV6_UDP (\\\n \tIAVF_INSET_IPV6_SRC | IAVF_INSET_IPV6_DST | \\\n \tIAVF_INSET_IPV6_TC | IAVF_INSET_IPV6_HOP_LIMIT | \\\n@@ -117,6 +120,7 @@ static struct iavf_pattern_match_item iavf_fdir_pattern[] = {\n \t{iavf_pattern_eth_ipv4_tcp,\t\tIAVF_FDIR_INSET_ETH_IPV4_TCP,\t\tIAVF_INSET_NONE},\n \t{iavf_pattern_eth_ipv4_sctp,\t\tIAVF_FDIR_INSET_ETH_IPV4_SCTP,\t\tIAVF_INSET_NONE},\n \t{iavf_pattern_eth_ipv6,\t\t\tIAVF_FDIR_INSET_ETH_IPV6,\t\tIAVF_INSET_NONE},\n+\t{iavf_pattern_eth_ipv6_frag_ext,\tIAVF_FDIR_INSET_ETH_IPV6_FRAG_EXT,\tIAVF_INSET_NONE},\n \t{iavf_pattern_eth_ipv6_udp,\t\tIAVF_FDIR_INSET_ETH_IPV6_UDP,\t\tIAVF_INSET_NONE},\n \t{iavf_pattern_eth_ipv6_tcp,\t\tIAVF_FDIR_INSET_ETH_IPV6_TCP,\t\tIAVF_INSET_NONE},\n \t{iavf_pattern_eth_ipv6_sctp,\t\tIAVF_FDIR_INSET_ETH_IPV6_SCTP,\t\tIAVF_INSET_NONE},\n@@ -496,12 +500,13 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,\n \t\t\tstruct iavf_fdir_conf *filter)\n {\n \tstruct virtchnl_proto_hdrs hdrs = filter->add_fltr.rule_cfg.proto_hdrs;\n-\tconst struct rte_flow_item *item = pattern;\n-\tenum rte_flow_item_type item_type;\n \tenum rte_flow_item_type l3 = RTE_FLOW_ITEM_TYPE_END;\n \tconst struct rte_flow_item_eth *eth_spec, *eth_mask;\n-\tconst struct rte_flow_item_ipv4 *ipv4_spec, *ipv4_mask;\n+\tconst struct rte_flow_item_ipv4 *ipv4_spec, *ipv4_last, *ipv4_mask;\n \tconst struct rte_flow_item_ipv6 *ipv6_spec, *ipv6_mask;\n+\tconst struct rte_flow_item_ipv6_frag_ext *ipv6_frag_spec;\n+\tconst struct rte_flow_item_ipv6_frag_ext *ipv6_frag_last;\n+\tconst struct rte_flow_item_ipv6_frag_ext *ipv6_frag_mask;\n \tconst struct rte_flow_item_udp *udp_spec, *udp_mask;\n \tconst struct rte_flow_item_tcp *tcp_spec, *tcp_mask;\n \tconst struct rte_flow_item_sctp *sctp_spec, *sctp_mask;\n@@ -512,15 +517,16 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,\n \tconst struct rte_flow_item_ah *ah_spec, *ah_mask;\n \tconst struct rte_flow_item_pfcp *pfcp_spec, *pfcp_mask;\n \tconst struct rte_flow_item_ecpri *ecpri_spec, *ecpri_mask;\n+\tconst struct rte_flow_item *item = pattern;\n+\tstruct virtchnl_proto_hdr *hdr, *hdr1 = NULL;\n \tstruct rte_ecpri_common_hdr ecpri_common;\n \tuint64_t input_set = IAVF_INSET_NONE;\n-\tuint8_t proto_id;\n-\n+\tenum rte_flow_item_type item_type;\n \tenum rte_flow_item_type next_type;\n+\tbool spec_all_pid = false;\n \tuint16_t ether_type;\n-\n+\tuint8_t proto_id;\n \tint layer = 0;\n-\tstruct virtchnl_proto_hdr *hdr;\n \n \tuint8_t  ipv6_addr_mask[16] = {\n \t\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n@@ -528,12 +534,6 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,\n \t};\n \n \tfor (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {\n-\t\tif (item->last) {\n-\t\t\trte_flow_error_set(error, EINVAL,\n-\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM, item,\n-\t\t\t\t\t\"Not support range\");\n-\t\t}\n-\n \t\titem_type = item->type;\n \n \t\tswitch (item_type) {\n@@ -542,12 +542,12 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,\n \t\t\teth_mask = item->mask;\n \t\t\tnext_type = (item + 1)->type;\n \n-\t\t\thdr = &hdrs.proto_hdr[layer];\n+\t\t\thdr1 = &hdrs.proto_hdr[layer];\n \n-\t\t\tVIRTCHNL_SET_PROTO_HDR_TYPE(hdr, ETH);\n+\t\t\tVIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, ETH);\n \n \t\t\tif (next_type == RTE_FLOW_ITEM_TYPE_END &&\n-\t\t\t\t(!eth_spec || !eth_mask)) {\n+\t\t\t    (!eth_spec || !eth_mask)) {\n \t\t\t\trte_flow_error_set(error, EINVAL,\n \t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n \t\t\t\t\t\titem, \"NULL eth spec/mask.\");\n@@ -583,10 +583,11 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,\n \t\t\t\t}\n \n \t\t\t\tinput_set |= IAVF_INSET_ETHERTYPE;\n-\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, ETH, ETHERTYPE);\n+\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1, ETH,\n+\t\t\t\t\t\t\t\t ETHERTYPE);\n \n-\t\t\t\trte_memcpy(hdr->buffer,\n-\t\t\t\t\teth_spec, sizeof(struct rte_ether_hdr));\n+\t\t\t\trte_memcpy(hdr1->buffer, eth_spec,\n+\t\t\t\t\t   sizeof(struct rte_ether_hdr));\n \t\t\t}\n \n \t\t\thdrs.count = ++layer;\n@@ -595,51 +596,85 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,\n \t\tcase RTE_FLOW_ITEM_TYPE_IPV4:\n \t\t\tl3 = RTE_FLOW_ITEM_TYPE_IPV4;\n \t\t\tipv4_spec = item->spec;\n+\t\t\tipv4_last = item->last;\n \t\t\tipv4_mask = item->mask;\n+\t\t\tnext_type = (item + 1)->type;\n \n \t\t\thdr = &hdrs.proto_hdr[layer];\n \n \t\t\tVIRTCHNL_SET_PROTO_HDR_TYPE(hdr, IPV4);\n \n-\t\t\tif (ipv4_spec && ipv4_mask) {\n-\t\t\t\tif (ipv4_mask->hdr.version_ihl ||\n-\t\t\t\t\tipv4_mask->hdr.total_length ||\n-\t\t\t\t\tipv4_mask->hdr.packet_id ||\n-\t\t\t\t\tipv4_mask->hdr.fragment_offset ||\n-\t\t\t\t\tipv4_mask->hdr.hdr_checksum) {\n-\t\t\t\t\trte_flow_error_set(error, EINVAL,\n-\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n-\t\t\t\t\t\titem, \"Invalid IPv4 mask.\");\n-\t\t\t\t\treturn -rte_errno;\n-\t\t\t\t}\n+\t\t\tif (!(ipv4_spec && ipv4_mask)) {\n+\t\t\t\thdrs.count = ++layer;\n+\t\t\t\tbreak;\n+\t\t\t}\n \n-\t\t\t\tif (ipv4_mask->hdr.type_of_service ==\n-\t\t\t\t\t\t\t\tUINT8_MAX) {\n-\t\t\t\t\tinput_set |= IAVF_INSET_IPV4_TOS;\n-\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4, DSCP);\n-\t\t\t\t}\n-\t\t\t\tif (ipv4_mask->hdr.next_proto_id == UINT8_MAX) {\n-\t\t\t\t\tinput_set |= IAVF_INSET_IPV4_PROTO;\n-\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4, PROT);\n-\t\t\t\t}\n-\t\t\t\tif (ipv4_mask->hdr.time_to_live == UINT8_MAX) {\n-\t\t\t\t\tinput_set |= IAVF_INSET_IPV4_TTL;\n-\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4, TTL);\n-\t\t\t\t}\n-\t\t\t\tif (ipv4_mask->hdr.src_addr == UINT32_MAX) {\n-\t\t\t\t\tinput_set |= IAVF_INSET_IPV4_SRC;\n-\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4, SRC);\n-\t\t\t\t}\n-\t\t\t\tif (ipv4_mask->hdr.dst_addr == UINT32_MAX) {\n-\t\t\t\t\tinput_set |= IAVF_INSET_IPV4_DST;\n-\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4, DST);\n-\t\t\t\t}\n+\t\t\tif (ipv4_mask->hdr.version_ihl ||\n+\t\t\t    ipv4_mask->hdr.total_length ||\n+\t\t\t    ipv4_mask->hdr.hdr_checksum) {\n+\t\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t\t   item, \"Invalid IPv4 mask.\");\n+\t\t\t\treturn -rte_errno;\n+\t\t\t}\n \n-\t\t\t\trte_memcpy(hdr->buffer,\n-\t\t\t\t\t&ipv4_spec->hdr,\n-\t\t\t\t\tsizeof(ipv4_spec->hdr));\n+\t\t\tif (ipv4_mask->hdr.type_of_service ==\n+\t\t\t    UINT8_MAX) {\n+\t\t\t\tinput_set |= IAVF_INSET_IPV4_TOS;\n+\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4,\n+\t\t\t\t\t\t\t\t DSCP);\n+\t\t\t}\n+\n+\t\t\tif (ipv4_mask->hdr.next_proto_id == UINT8_MAX) {\n+\t\t\t\tinput_set |= IAVF_INSET_IPV4_PROTO;\n+\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4,\n+\t\t\t\t\t\t\t\t PROT);\n+\t\t\t}\n+\n+\t\t\tif (ipv4_mask->hdr.time_to_live == UINT8_MAX) {\n+\t\t\t\tinput_set |= IAVF_INSET_IPV4_TTL;\n+\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4,\n+\t\t\t\t\t\t\t\t TTL);\n+\t\t\t}\n+\n+\t\t\tif (ipv4_mask->hdr.src_addr == UINT32_MAX) {\n+\t\t\t\tinput_set |= IAVF_INSET_IPV4_SRC;\n+\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4,\n+\t\t\t\t\t\t\t\t SRC);\n+\t\t\t}\n+\n+\t\t\tif (ipv4_mask->hdr.dst_addr == UINT32_MAX) {\n+\t\t\t\tinput_set |= IAVF_INSET_IPV4_DST;\n+\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4,\n+\t\t\t\t\t\t\t\t DST);\n+\t\t\t}\n+\n+\t\t\tif (ipv4_mask->hdr.packet_id == UINT16_MAX ||\n+\t\t\t    ipv4_mask->hdr.fragment_offset == UINT16_MAX) {\n+\t\t\t\tif (ipv4_last &&\n+\t\t\t\t    ipv4_spec->hdr.packet_id == 0 &&\n+\t\t\t\t    ipv4_last->hdr.packet_id == 0xffff)\n+\t\t\t\t\tspec_all_pid = true;\n+\n+\t\t\t\t/* All IPv4 fragment packet has the same\n+\t\t\t\t * ethertype, if the spec is for all invalid\n+\t\t\t\t * packet id, set the ethertype into input set.\n+\t\t\t\t */\n+\t\t\t\tinput_set |= spec_all_pid ?\n+\t\t\t\t\tIAVF_INSET_ETHERTYPE :\n+\t\t\t\t\tIAVF_INSET_IPV4_ID;\n+\n+\t\t\t\tif (spec_all_pid)\n+\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1,\n+\t\t\t\t\t\tETH, ETHERTYPE);\n+\t\t\t\telse\n+\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr,\n+\t\t\t\t\t\tIPV4, PKID);\n \t\t\t}\n \n+\t\t\trte_memcpy(hdr->buffer, &ipv4_spec->hdr,\n+\t\t\t\t   sizeof(ipv4_spec->hdr));\n+\n \t\t\thdrs.count = ++layer;\n \t\t\tbreak;\n \n@@ -652,46 +687,98 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,\n \n \t\t\tVIRTCHNL_SET_PROTO_HDR_TYPE(hdr, IPV6);\n \n-\t\t\tif (ipv6_spec && ipv6_mask) {\n-\t\t\t\tif (ipv6_mask->hdr.payload_len) {\n-\t\t\t\t\trte_flow_error_set(error, EINVAL,\n-\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n-\t\t\t\t\t\titem, \"Invalid IPv6 mask\");\n-\t\t\t\t\treturn -rte_errno;\n-\t\t\t\t}\n+\t\t\tif (!(ipv6_spec && ipv6_mask)) {\n+\t\t\t\thdrs.count = ++layer;\n+\t\t\t\tbreak;\n+\t\t\t}\n \n-\t\t\t\tif ((ipv6_mask->hdr.vtc_flow &\n-\t\t\t\t\trte_cpu_to_be_32(IAVF_IPV6_TC_MASK))\n-\t\t\t\t\t== rte_cpu_to_be_32(IAVF_IPV6_TC_MASK)) {\n-\t\t\t\t\tinput_set |= IAVF_INSET_IPV6_TC;\n-\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6, TC);\n-\t\t\t\t}\n-\t\t\t\tif (ipv6_mask->hdr.proto == UINT8_MAX) {\n-\t\t\t\t\tinput_set |= IAVF_INSET_IPV6_NEXT_HDR;\n-\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6, PROT);\n-\t\t\t\t}\n-\t\t\t\tif (ipv6_mask->hdr.hop_limits == UINT8_MAX) {\n-\t\t\t\t\tinput_set |= IAVF_INSET_IPV6_HOP_LIMIT;\n-\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6, HOP_LIMIT);\n-\t\t\t\t}\n-\t\t\t\tif (!memcmp(ipv6_mask->hdr.src_addr,\n-\t\t\t\t\tipv6_addr_mask,\n-\t\t\t\t\tRTE_DIM(ipv6_mask->hdr.src_addr))) {\n-\t\t\t\t\tinput_set |= IAVF_INSET_IPV6_SRC;\n-\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6, SRC);\n-\t\t\t\t}\n-\t\t\t\tif (!memcmp(ipv6_mask->hdr.dst_addr,\n-\t\t\t\t\tipv6_addr_mask,\n-\t\t\t\t\tRTE_DIM(ipv6_mask->hdr.dst_addr))) {\n-\t\t\t\t\tinput_set |= IAVF_INSET_IPV6_DST;\n-\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6, DST);\n-\t\t\t\t}\n+\t\t\tif (ipv6_mask->hdr.payload_len) {\n+\t\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t\t   item, \"Invalid IPv6 mask\");\n+\t\t\t\treturn -rte_errno;\n+\t\t\t}\n \n-\t\t\t\trte_memcpy(hdr->buffer,\n-\t\t\t\t\t&ipv6_spec->hdr,\n-\t\t\t\t\tsizeof(ipv6_spec->hdr));\n+\t\t\tif ((ipv6_mask->hdr.vtc_flow &\n+\t\t\t      rte_cpu_to_be_32(IAVF_IPV6_TC_MASK))\n+\t\t\t     == rte_cpu_to_be_32(IAVF_IPV6_TC_MASK)) {\n+\t\t\t\tinput_set |= IAVF_INSET_IPV6_TC;\n+\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6,\n+\t\t\t\t\t\t\t\t TC);\n+\t\t\t}\n+\n+\t\t\tif (ipv6_mask->hdr.proto == UINT8_MAX) {\n+\t\t\t\tinput_set |= IAVF_INSET_IPV6_NEXT_HDR;\n+\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6,\n+\t\t\t\t\t\t\t\t PROT);\n+\t\t\t}\n+\n+\t\t\tif (ipv6_mask->hdr.hop_limits == UINT8_MAX) {\n+\t\t\t\tinput_set |= IAVF_INSET_IPV6_HOP_LIMIT;\n+\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6,\n+\t\t\t\t\t\t\t\t HOP_LIMIT);\n \t\t\t}\n \n+\t\t\tif (!memcmp(ipv6_mask->hdr.src_addr, ipv6_addr_mask,\n+\t\t\t\t    RTE_DIM(ipv6_mask->hdr.src_addr))) {\n+\t\t\t\tinput_set |= IAVF_INSET_IPV6_SRC;\n+\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6,\n+\t\t\t\t\t\t\t\t SRC);\n+\t\t\t}\n+\t\t\tif (!memcmp(ipv6_mask->hdr.dst_addr, ipv6_addr_mask,\n+\t\t\t\t    RTE_DIM(ipv6_mask->hdr.dst_addr))) {\n+\t\t\t\tinput_set |= IAVF_INSET_IPV6_DST;\n+\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6,\n+\t\t\t\t\t\t\t\t DST);\n+\t\t\t}\n+\n+\t\t\trte_memcpy(hdr->buffer, &ipv6_spec->hdr,\n+\t\t\t\t   sizeof(ipv6_spec->hdr));\n+\n+\t\t\thdrs.count = ++layer;\n+\t\t\tbreak;\n+\n+\t\tcase RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT:\n+\t\t\tipv6_frag_spec = item->spec;\n+\t\t\tipv6_frag_last = item->last;\n+\t\t\tipv6_frag_mask = item->mask;\n+\t\t\tnext_type = (item + 1)->type;\n+\n+\t\t\thdr = &hdrs.proto_hdr[layer];\n+\n+\t\t\tVIRTCHNL_SET_PROTO_HDR_TYPE(hdr, IPV6_EH_FRAG);\n+\n+\t\t\tif (!(ipv6_frag_spec && ipv6_frag_mask)) {\n+\t\t\t\thdrs.count = ++layer;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\tif (ipv6_frag_mask->hdr.id == UINT32_MAX ||\n+\t\t\t    ipv6_frag_mask->hdr.frag_data == UINT16_MAX) {\n+\t\t\t\tif (ipv6_frag_last &&\n+\t\t\t\t    ipv6_frag_spec->hdr.id == 0 &&\n+\t\t\t\t    ipv6_frag_last->hdr.id == 0xffffffff)\n+\t\t\t\t\tspec_all_pid = true;\n+\n+\t\t\t\t/* All IPv6 fragment packet has the\n+\t\t\t\t * same ethertype, if the spec is for\n+\t\t\t\t * all invalid packet id, set the\n+\t\t\t\t * ethertype into input set.\n+\t\t\t\t */\n+\t\t\t\tinput_set |= spec_all_pid ?\n+\t\t\t\t\tIAVF_INSET_ETHERTYPE :\n+\t\t\t\t\tIAVF_INSET_IPV6_ID;\n+\t\t\t\tif (spec_all_pid)\n+\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1,\n+\t\t\t\t\t\t\tETH, ETHERTYPE);\n+\t\t\t\telse\n+\t\t\t\t\tVIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr,\n+\t\t\t\t\t\t\tIPV6, PKID);\n+\t\t\t}\n+\n+\t\t\trte_memcpy(hdr->buffer, &ipv6_frag_spec->hdr,\n+\t\t\t\t   sizeof(ipv6_frag_spec->hdr));\n+\n \t\t\thdrs.count = ++layer;\n \t\t\tbreak;\n \n@@ -1009,8 +1096,13 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,\n \t\treturn -rte_errno;\n \t}\n \n-\tif (input_set & ~input_set_mask)\n-\t\treturn -EINVAL;\n+\tif (spec_all_pid) {\n+\t\tif (input_set & ~(input_set_mask | IAVF_INSET_ETHERTYPE))\n+\t\t\treturn -EINVAL;\n+\t} else {\n+\t\tif (input_set & ~input_set_mask)\n+\t\t\treturn -EINVAL;\n+\t}\n \n \tfilter->input_set = input_set;\n \ndiff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h\nindex ce3d12bcd9..f17fc91bfa 100644\n--- a/drivers/net/iavf/iavf_generic_flow.h\n+++ b/drivers/net/iavf/iavf_generic_flow.h\n@@ -61,6 +61,7 @@\n #define IAVF_PFCP_S_FIELD\t    (1ULL << 44)\n #define IAVF_PFCP_SEID\t\t    (1ULL << 43)\n #define IAVF_ECPRI_PC_RTC_ID\t    (1ULL << 42)\n+#define IAVF_IP_PK_ID\t\t    (1ULL << 41)\n \n /* input set */\n \n@@ -84,6 +85,8 @@\n \t(IAVF_PROT_IPV4_OUTER | IAVF_IP_PROTO)\n #define IAVF_INSET_IPV4_TTL \\\n \t(IAVF_PROT_IPV4_OUTER | IAVF_IP_TTL)\n+#define IAVF_INSET_IPV4_ID \\\n+\t(IAVF_PROT_IPV4_OUTER | IAVF_IP_PK_ID)\n #define IAVF_INSET_IPV6_SRC \\\n \t(IAVF_PROT_IPV6_OUTER | IAVF_IP_SRC)\n #define IAVF_INSET_IPV6_DST \\\n@@ -94,6 +97,8 @@\n \t(IAVF_PROT_IPV6_OUTER | IAVF_IP_TTL)\n #define IAVF_INSET_IPV6_TC \\\n \t(IAVF_PROT_IPV6_OUTER | IAVF_IP_TOS)\n+#define IAVF_INSET_IPV6_ID \\\n+\t(IAVF_PROT_IPV6_OUTER | IAVF_IP_PK_ID)\n \n #define IAVF_INSET_TCP_SRC_PORT \\\n \t(IAVF_PROT_TCP_OUTER | IAVF_SPORT)\n",
    "prefixes": [
        "v1",
        "4/4"
    ]
}