Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/25363/?format=api
https://patches.dpdk.org/api/patches/25363/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1497582905-3058-1-git-send-email-wei.zhao1@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": "<1497582905-3058-1-git-send-email-wei.zhao1@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1497582905-3058-1-git-send-email-wei.zhao1@intel.com", "date": "2017-06-16T03:15:04", "name": "[dpdk-dev,1/2] net/e1000: fix flex type filter", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "5cd95874e51707135a906c6c79cd51563925b5b2", "submitter": { "id": 495, "url": "https://patches.dpdk.org/api/people/495/?format=api", "name": "Zhao1, Wei", "email": "wei.zhao1@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1497582905-3058-1-git-send-email-wei.zhao1@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/25363/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/25363/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 2EAD02BF1;\n\tFri, 16 Jun 2017 05:24:48 +0200 (CEST)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id 0D3592BD1\n\tfor <dev@dpdk.org>; Fri, 16 Jun 2017 05:24:46 +0200 (CEST)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga104.jf.intel.com with ESMTP; 15 Jun 2017 20:24:45 -0700", "from dpdk1.bj.intel.com ([172.16.182.84])\n\tby fmsmga001.fm.intel.com with ESMTP; 15 Jun 2017 20:24:44 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.39,346,1493708400\"; d=\"scan'208\";\n\ta=\"1161133490\"", "From": "Wei Zhao <wei.zhao1@intel.com>", "To": "dev@dpdk.org", "Cc": "wenzhuo.lu@intel.com,\n\tWei Zhao <wei.zhao1@intel.com>", "Date": "Fri, 16 Jun 2017 11:15:04 +0800", "Message-Id": "<1497582905-3058-1-git-send-email-wei.zhao1@intel.com>", "X-Mailer": "git-send-email 2.5.5", "Subject": "[dpdk-dev] [PATCH 1/2] net/e1000: fix flex type filter", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Fix bug in parse the flex info of wrong use local\nvarible index which will cause filter fail.\n\nFixes: 7cd77faf7129 (\"net/igb: parse flow API flex filter\")\n\nSigned-off-by: Wei Zhao <wei.zhao1@intel.com>\n---\n drivers/net/e1000/igb_flow.c | 57 +++++++++++++++++++++++++++++++-------------\n 1 file changed, 41 insertions(+), 16 deletions(-)", "diff": "diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c\nindex ce48c0d..98538e6 100644\n--- a/drivers/net/e1000/igb_flow.c\n+++ b/drivers/net/e1000/igb_flow.c\n@@ -77,6 +77,8 @@\n \t\t}\t\t\t\t\t\t\\\n \t} while (0)\n \n+#define\tIGB_FLEX_RAW_NUM\t12\n+\n /**\n * Please aware there's an asumption for all the parsers.\n * rte_flow_item is using big endian, rte_flow_attr and\n@@ -1043,8 +1045,11 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,\n \tconst struct rte_flow_item_raw *raw_spec;\n \tconst struct rte_flow_item_raw *raw_mask;\n \tconst struct rte_flow_action_queue *act_q;\n-\tuint32_t index, i, offset, total_offset = 0;\n-\tint32_t shift;\n+\tuint32_t index, i, offset, total_offset;\n+\tuint32_t max_offset = 0;\n+\tint32_t shift, j, raw_index = 0;\n+\tint32_t relative[IGB_FLEX_RAW_NUM] = {0};\n+\tint32_t\traw_offset[IGB_FLEX_RAW_NUM] = {0};\n \n \tif (!pattern) {\n \t\trte_flow_error_set(error, EINVAL,\n@@ -1105,8 +1110,8 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,\n \telse\n \t\toffset = 0;\n \n-\tfor (index = 0; index < raw_spec->length; index++) {\n-\t\tif (raw_mask->pattern[index] != 0xFF) {\n+\tfor (j = 0; j < raw_spec->length; j++) {\n+\t\tif (raw_mask->pattern[j] != 0xFF) {\n \t\t\tmemset(filter, 0, sizeof(struct rte_eth_flex_filter));\n \t\t\trte_flow_error_set(error, EINVAL,\n \t\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n@@ -1115,6 +1120,21 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,\n \t\t}\n \t}\n \n+\ttotal_offset = 0;\n+\n+\tif (raw_spec->relative) {\n+\t\tfor (j = raw_index; j > 0; j--) {\n+\t\t\ttotal_offset += raw_offset[j - 1];\n+\t\t\tif (!relative[j - 1])\n+\t\t\t\tbreak;\n+\t\t}\n+\t\tif (total_offset + raw_spec->length + offset > max_offset)\n+\t\t\tmax_offset = total_offset + raw_spec->length + offset;\n+\t} else {\n+\t\tif (raw_spec->length + offset > max_offset)\n+\t\t\tmax_offset = raw_spec->length + offset;\n+\t}\n+\n \tif ((raw_spec->length + offset + total_offset) >\n \t\t\tRTE_FLEX_FILTER_MAXLEN) {\n \t\tmemset(filter, 0, sizeof(struct rte_eth_flex_filter));\n@@ -1125,30 +1145,35 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,\n \t}\n \n \tif (raw_spec->relative == 0) {\n-\t\tfor (index = 0; index < raw_spec->length; index++)\n-\t\t\tfilter->bytes[index] = raw_spec->pattern[index];\n-\t\tindex = offset / CHAR_BIT;\n+\t\tfor (j = 0; j < raw_spec->length; j++)\n+\t\t\tfilter->bytes[offset + j] =\n+\t\t\traw_spec->pattern[j];\n+\t\tj = offset / CHAR_BIT;\n+\t\tshift = offset % CHAR_BIT;\n \t} else {\n-\t\tfor (index = 0; index < raw_spec->length; index++)\n-\t\t\tfilter->bytes[total_offset + index] =\n-\t\t\t\traw_spec->pattern[index];\n-\t\tindex = (total_offset + offset) / CHAR_BIT;\n+\t\tfor (j = 0; j < raw_spec->length; j++)\n+\t\t\tfilter->bytes[total_offset + offset + j] =\n+\t\t\t\traw_spec->pattern[j];\n+\t\tj = (total_offset + offset) / CHAR_BIT;\n+\t\tshift = (total_offset + offset) % CHAR_BIT;\n \t}\n \n \ti = 0;\n \n-\tfor (shift = offset % CHAR_BIT; shift < CHAR_BIT; shift++) {\n-\t\tfilter->mask[index] |= (0x80 >> shift);\n+\tfor ( ; shift < CHAR_BIT; shift++) {\n+\t\tfilter->mask[j] |= (0x80 >> shift);\n \t\ti++;\n \t\tif (i == raw_spec->length)\n \t\t\tbreak;\n \t\tif (shift == (CHAR_BIT - 1)) {\n-\t\t\tindex++;\n+\t\t\tj++;\n \t\t\tshift = -1;\n \t\t}\n \t}\n \n-\ttotal_offset += offset + raw_spec->length;\n+\trelative[raw_index] = raw_spec->relative;\n+\traw_offset[raw_index] = offset + raw_spec->length;\n+\traw_index++;\n \n \t/* check if the next not void item is RAW */\n \tindex++;\n@@ -1167,7 +1192,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,\n \t\tgoto item_loop;\n \t}\n \n-\tfilter->len = RTE_ALIGN(total_offset, 8);\n+\tfilter->len = RTE_ALIGN(max_offset, 8);\n \n \t/* parse action */\n \tindex = 0;\n", "prefixes": [ "dpdk-dev", "1/2" ] }{ "id": 25363, "url": "