Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/88347/?format=api
http://patches.dpdk.org/api/patches/88347/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210302070320.1872968-1-xiaoyun.li@intel.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": "<20210302070320.1872968-1-xiaoyun.li@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210302070320.1872968-1-xiaoyun.li@intel.com", "date": "2021-03-02T07:03:20", "name": "[v2] net/i40e: fix IPv4 fragment offload issue", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "d2aac1fedec0e1d29082daaa603796684015febf", "submitter": { "id": 798, "url": "http://patches.dpdk.org/api/people/798/?format=api", "name": "Li, Xiaoyun", "email": "xiaoyun.li@intel.com" }, "delegate": { "id": 1540, "url": "http://patches.dpdk.org/api/users/1540/?format=api", "username": "qzhan15", "first_name": "Qi", "last_name": "Zhang", "email": "qi.z.zhang@intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210302070320.1872968-1-xiaoyun.li@intel.com/mbox/", "series": [ { "id": 15434, "url": "http://patches.dpdk.org/api/series/15434/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15434", "date": "2021-03-02T07:03:20", "name": "[v2] net/i40e: fix IPv4 fragment offload issue", "version": 2, "mbox": "http://patches.dpdk.org/series/15434/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/88347/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/88347/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 691C6A054F;\n\tTue, 2 Mar 2021 08:06:55 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id F2E484014E;\n\tTue, 2 Mar 2021 08:06:54 +0100 (CET)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id CC7DD40142;\n Tue, 2 Mar 2021 08:06:53 +0100 (CET)", "from orsmga001.jf.intel.com ([10.7.209.18])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Mar 2021 23:06:52 -0800", "from dpdk-xiaoyunl.sh.intel.com ([10.67.111.154])\n by orsmga001.jf.intel.com with ESMTP; 01 Mar 2021 23:06:50 -0800" ], "IronPort-SDR": [ "\n lmcKRKB3xRDQ5tEAhANY/5Ct92ENqXAmAnQ6EXYSdvU33R980qogBt2ZgdlR2R7Lc1qnAEjUyE\n oi95GdKThkIA==", "\n xPOpuAvdDHgdZU4EhkZedRf1dXTypH3RdG1Lo/yC4MNXfCcgr3dWaaslSRD6taJ2UjtzfY3iPb\n K9GxX1wylSDg==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9910\"; a=\"186830077\"", "E=Sophos;i=\"5.81,216,1610438400\"; d=\"scan'208\";a=\"186830077\"", "E=Sophos;i=\"5.81,216,1610438400\"; d=\"scan'208\";a=\"444627300\"" ], "X-ExtLoop1": "1", "From": "Xiaoyun Li <xiaoyun.li@intel.com>", "To": "Beilei Xing <beilei.xing@intel.com>, Jeff Guo <jia.guo@intel.com>,\n Wenzhuo Lu <wenzhuo.lu@intel.com>", "Cc": "dev@dpdk.org,\n\tXiaoyun Li <xiaoyun.li@intel.com>,\n\tstable@dpdk.org", "Date": "Tue, 2 Mar 2021 15:03:20 +0800", "Message-Id": "<20210302070320.1872968-1-xiaoyun.li@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210226081438.1693788-1-xiaoyun.li@intel.com>", "References": "<20210226081438.1693788-1-xiaoyun.li@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v2] net/i40e: fix IPv4 fragment offload issue", "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": "IPv4 fragment_offset mask was required to be 0 no matter what the\nspec value was. But zero mask means not caring about fragment_offset\nfield then both non-frag and frag packets should hit the rule.\n\nBut the actual fragment rules should be like the following:\nOnly non-fragment packets can hit Rule 1:\nRule 1: mask=0x3fff, spec=0\nOnly fragment packets can hit rule 2:\nRule 2: mask=0x3fff, spec=0x8, last=0x2000\n\nThis patch allows the above rules.\n\nFixes: 42044b69c67d (\"net/i40e: support input set selection for FDIR\")\nCc: stable@dpdk.org\n\nSigned-off-by: Xiaoyun Li <xiaoyun.li@intel.com>\n---\nv2:\n* Fixed a typo.\n* Print comment in one line.\n\n drivers/net/i40e/i40e_flow.c | 87 ++++++++++++++++++++++++++++++++----\n 1 file changed, 78 insertions(+), 9 deletions(-)", "diff": "diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c\nindex 4d44282312..3e514d5f38 100644\n--- a/drivers/net/i40e/i40e_flow.c\n+++ b/drivers/net/i40e/i40e_flow.c\n@@ -2433,7 +2433,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,\n \tconst struct rte_flow_item *item = pattern;\n \tconst struct rte_flow_item_eth *eth_spec, *eth_mask;\n \tconst struct rte_flow_item_vlan *vlan_spec, *vlan_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_tcp *tcp_spec, *tcp_mask;\n \tconst struct rte_flow_item_udp *udp_spec, *udp_mask;\n@@ -2446,7 +2446,6 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,\n \n \tuint8_t pctype = 0;\n \tuint64_t input_set = I40E_INSET_NONE;\n-\tuint16_t frag_off;\n \tenum rte_flow_item_type item_type;\n \tenum rte_flow_item_type next_type;\n \tenum rte_flow_item_type l3 = RTE_FLOW_ITEM_TYPE_END;\n@@ -2472,7 +2471,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,\n \tmemset(len_arr, 0, sizeof(len_arr));\n \tfilter->input.flow_ext.customized_pctype = false;\n \tfor (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {\n-\t\tif (item->last) {\n+\t\tif (item->last && item->type != RTE_FLOW_ITEM_TYPE_IPV4) {\n \t\t\trte_flow_error_set(error, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ITEM,\n \t\t\t\t\t item,\n@@ -2611,15 +2610,40 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,\n \t\t\tl3 = RTE_FLOW_ITEM_TYPE_IPV4;\n \t\t\tipv4_spec = item->spec;\n \t\t\tipv4_mask = item->mask;\n+\t\t\tipv4_last = item->last;\n \t\t\tpctype = I40E_FILTER_PCTYPE_NONF_IPV4_OTHER;\n \t\t\tlayer_idx = I40E_FLXPLD_L3_IDX;\n \n+\t\t\tif (ipv4_last) {\n+\t\t\t\tif (!ipv4_spec || !ipv4_mask || !outer_ip) {\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,\n+\t\t\t\t\t\t\"Not support range\");\n+\t\t\t\t\treturn -rte_errno;\n+\t\t\t\t}\n+\t\t\t\t/* Only fragment_offset supports range */\n+\t\t\t\tif (ipv4_last->hdr.version_ihl ||\n+\t\t\t\t ipv4_last->hdr.type_of_service ||\n+\t\t\t\t ipv4_last->hdr.total_length ||\n+\t\t\t\t ipv4_last->hdr.packet_id ||\n+\t\t\t\t ipv4_last->hdr.time_to_live ||\n+\t\t\t\t ipv4_last->hdr.next_proto_id ||\n+\t\t\t\t ipv4_last->hdr.hdr_checksum ||\n+\t\t\t\t ipv4_last->hdr.src_addr ||\n+\t\t\t\t ipv4_last->hdr.dst_addr) {\n+\t\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,\n+\t\t\t\t\t\t \"Not support range\");\n+\t\t\t\t\treturn -rte_errno;\n+\t\t\t\t}\n+\t\t\t}\n \t\t\tif (ipv4_spec && ipv4_mask && outer_ip) {\n \t\t\t\t/* Check IPv4 mask and update input set */\n \t\t\t\tif (ipv4_mask->hdr.version_ihl ||\n \t\t\t\t ipv4_mask->hdr.total_length ||\n \t\t\t\t ipv4_mask->hdr.packet_id ||\n-\t\t\t\t ipv4_mask->hdr.fragment_offset ||\n \t\t\t\t ipv4_mask->hdr.hdr_checksum) {\n \t\t\t\t\trte_flow_error_set(error, EINVAL,\n \t\t\t\t\t\t RTE_FLOW_ERROR_TYPE_ITEM,\n@@ -2640,11 +2664,56 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,\n \t\t\t\t\tinput_set |= I40E_INSET_IPV4_PROTO;\n \n \t\t\t\t/* Check if it is fragment. */\n-\t\t\t\tfrag_off = ipv4_spec->hdr.fragment_offset;\n-\t\t\t\tfrag_off = rte_be_to_cpu_16(frag_off);\n-\t\t\t\tif (frag_off & RTE_IPV4_HDR_OFFSET_MASK ||\n-\t\t\t\t frag_off & RTE_IPV4_HDR_MF_FLAG)\n-\t\t\t\t\tpctype = I40E_FILTER_PCTYPE_FRAG_IPV4;\n+\t\t\t\tuint16_t frag_mask =\n+\t\t\t\t\tipv4_mask->hdr.fragment_offset;\n+\t\t\t\tuint16_t frag_spec =\n+\t\t\t\t\tipv4_spec->hdr.fragment_offset;\n+\t\t\t\tuint16_t frag_last = 0;\n+\t\t\t\tif (ipv4_last)\n+\t\t\t\t\tfrag_last =\n+\t\t\t\t\tipv4_last->hdr.fragment_offset;\n+\t\t\t\tif (frag_mask) {\n+\t\t\t\t\tfrag_mask = rte_be_to_cpu_16(frag_mask);\n+\t\t\t\t\tfrag_spec = rte_be_to_cpu_16(frag_spec);\n+\t\t\t\t\tfrag_last = rte_be_to_cpu_16(frag_last);\n+\t\t\t\t\t/* frag_off mask has to be 0x3fff */\n+\t\t\t\t\tif (frag_mask !=\n+\t\t\t\t\t (RTE_IPV4_HDR_OFFSET_MASK |\n+\t\t\t\t\t RTE_IPV4_HDR_MF_FLAG)) {\n+\t\t\t\t\t\trte_flow_error_set(error,\n+\t\t\t\t\t\t EINVAL,\n+\t\t\t\t\t\t RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t\t item,\n+\t\t\t\t\t\t \"Invalid IPv4 fragment_offset mask\");\n+\t\t\t\t\t\treturn -rte_errno;\n+\t\t\t\t\t}\n+\t\t\t\t\t/*\n+\t\t\t\t\t * non-frag rule:\n+\t\t\t\t\t * mask=0x3fff,spec=0\n+\t\t\t\t\t * frag rule:\n+\t\t\t\t\t * mask=0x3fff,spec=0x8,last=0x2000\n+\t\t\t\t\t */\n+\t\t\t\t\tif (frag_spec ==\n+\t\t\t\t\t (1 << RTE_IPV4_HDR_FO_SHIFT) &&\n+\t\t\t\t\t frag_last == RTE_IPV4_HDR_MF_FLAG) {\n+\t\t\t\t\t\tpctype =\n+\t\t\t\t\t\t I40E_FILTER_PCTYPE_FRAG_IPV4;\n+\t\t\t\t\t} else if (frag_spec || frag_last) {\n+\t\t\t\t\t\trte_flow_error_set(error,\n+\t\t\t\t\t\t EINVAL,\n+\t\t\t\t\t\t RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t\t item,\n+\t\t\t\t\t\t \"Invalid IPv4 fragment_offset rule\");\n+\t\t\t\t\t\treturn -rte_errno;\n+\t\t\t\t\t}\n+\t\t\t\t} else if (frag_spec || frag_last) {\n+\t\t\t\t\trte_flow_error_set(error,\n+\t\t\t\t\t\tEINVAL,\n+\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t\titem,\n+\t\t\t\t\t\t\"Invalid fragment_offset\");\n+\t\t\t\t\treturn -rte_errno;\n+\t\t\t\t}\n \n \t\t\t\tif (input_set & (I40E_INSET_DMAC | I40E_INSET_SMAC)) {\n \t\t\t\t\tif (input_set & (I40E_INSET_IPV4_SRC |\n", "prefixes": [ "v2" ] }{ "id": 88347, "url": "