get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 21598,
    "url": "https://patches.dpdk.org/api/patches/21598/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1488959911-24125-2-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": "<1488959911-24125-2-git-send-email-wei.zhao1@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1488959911-24125-2-git-send-email-wei.zhao1@intel.com",
    "date": "2017-03-08T07:58:31",
    "name": "[dpdk-dev,v2,2/2] net/ixgbe: add mac type check for all filters",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c93f5061797f2a635703179435a8956c778bf87c",
    "submitter": {
        "id": 495,
        "url": "https://patches.dpdk.org/api/people/495/?format=api",
        "name": "Zhao1, Wei",
        "email": "wei.zhao1@intel.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/1488959911-24125-2-git-send-email-wei.zhao1@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/21598/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/21598/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 DFF26952;\n\tWed,  8 Mar 2017 09:11:10 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 3921B952\n\tfor <dev@dpdk.org>; Wed,  8 Mar 2017 09:11:08 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t08 Mar 2017 00:05:38 -0800",
            "from dpdk1.bj.intel.com ([172.16.182.84])\n\tby fmsmga001.fm.intel.com with ESMTP; 08 Mar 2017 00:05:33 -0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.36,262,1486454400\"; d=\"scan'208\";\n\ta=\"1119879911\"",
        "From": "Wei Zhao <wei.zhao1@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com, Wei Zhao <wei.zhao1@intel.com>,\n\tWenzhuo Lu <wenzhuo.lu@intel.com>",
        "Date": "Wed,  8 Mar 2017 15:58:31 +0800",
        "Message-Id": "<1488959911-24125-2-git-send-email-wei.zhao1@intel.com>",
        "X-Mailer": "git-send-email 2.5.5",
        "In-Reply-To": "<1488959911-24125-1-git-send-email-wei.zhao1@intel.com>",
        "References": "<1488959911-24125-1-git-send-email-wei.zhao1@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 2/2] net/ixgbe: add mac type check for all\n\tfilters",
        "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": "All kinds of filter need to hardware mac type check\nto make sure the hardware support that type of fliter.\nIf not, it may cause serious issue.\n\nv2:\n delete useless function declaration\n\nFixes: 11777435c727 (\"net/ixgbe: parse flow director filter\")\nFixes: 672be56d76a2 (\"net/ixgbe: parse n-tuple filter\")\nFixes: eb3539fc8550 (\"net/ixgbe: parse ethertype filter\")\nFixes: 429f6ebb42cc (\"net/ixgbe: parse TCP SYN filter\")\n\nSigned-off-by: Wei Zhao <wei.zhao1@intel.com>\nSigned-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>\n\n---\n drivers/net/ixgbe/ixgbe_flow.c | 76 ++++++++++++++++++++++--------------------\n 1 file changed, 40 insertions(+), 36 deletions(-)",
    "diff": "diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c\nindex 48a06a6..e2ba9c2 100644\n--- a/drivers/net/ixgbe/ixgbe_flow.c\n+++ b/drivers/net/ixgbe/ixgbe_flow.c\n@@ -420,13 +420,17 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,\n \n /* a specific function for ixgbe because the flags is specific */\n static int\n-ixgbe_parse_ntuple_filter(const struct rte_flow_attr *attr,\n+ixgbe_parse_ntuple_filter(struct rte_eth_dev *dev,\n+\t\t\t  const struct rte_flow_attr *attr,\n \t\t\t  const struct rte_flow_item pattern[],\n \t\t\t  const struct rte_flow_action actions[],\n \t\t\t  struct rte_eth_ntuple_filter *filter,\n \t\t\t  struct rte_flow_error *error)\n {\n \tint ret;\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\n+\tMAC_TYPE_FILTER_SUP_EXT(hw->mac.type);\n \n \tret = cons_parse_ntuple_filter(attr, pattern, actions, filter, error);\n \n@@ -668,13 +672,17 @@ cons_parse_ethertype_filter(const struct rte_flow_attr *attr,\n }\n \n static int\n-ixgbe_parse_ethertype_filter(const struct rte_flow_attr *attr,\n+ixgbe_parse_ethertype_filter(struct rte_eth_dev *dev,\n+\t\t\t\t const struct rte_flow_attr *attr,\n \t\t\t     const struct rte_flow_item pattern[],\n \t\t\t     const struct rte_flow_action actions[],\n \t\t\t     struct rte_eth_ethertype_filter *filter,\n \t\t\t     struct rte_flow_error *error)\n {\n \tint ret;\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\n+\tMAC_TYPE_FILTER_SUP(hw->mac.type);\n \n \tret = cons_parse_ethertype_filter(attr, pattern,\n \t\t\t\t\tactions, filter, error);\n@@ -963,13 +971,17 @@ cons_parse_syn_filter(const struct rte_flow_attr *attr,\n }\n \n static int\n-ixgbe_parse_syn_filter(const struct rte_flow_attr *attr,\n+ixgbe_parse_syn_filter(struct rte_eth_dev *dev,\n+\t\t\t\t const struct rte_flow_attr *attr,\n \t\t\t     const struct rte_flow_item pattern[],\n \t\t\t     const struct rte_flow_action actions[],\n \t\t\t     struct rte_eth_syn_filter *filter,\n \t\t\t     struct rte_flow_error *error)\n {\n \tint ret;\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\n+\tMAC_TYPE_FILTER_SUP(hw->mac.type);\n \n \tret = cons_parse_syn_filter(attr, pattern,\n \t\t\t\t\tactions, filter, error);\n@@ -1152,7 +1164,7 @@ cons_parse_l2_tn_filter(const struct rte_flow_attr *attr,\n }\n \n static int\n-ixgbe_validate_l2_tn_filter(struct rte_eth_dev *dev,\n+ixgbe_parse_l2_tn_filter(struct rte_eth_dev *dev,\n \t\t\tconst struct rte_flow_attr *attr,\n \t\t\tconst struct rte_flow_item pattern[],\n \t\t\tconst struct rte_flow_action actions[],\n@@ -2306,46 +2318,37 @@ ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,\n }\n \n static int\n-ixgbe_parse_fdir_filter(const struct rte_flow_attr *attr,\n+ixgbe_parse_fdir_filter(struct rte_eth_dev *dev,\n+\t\t\tconst struct rte_flow_attr *attr,\n \t\t\tconst struct rte_flow_item pattern[],\n \t\t\tconst struct rte_flow_action actions[],\n \t\t\tstruct ixgbe_fdir_rule *rule,\n \t\t\tstruct rte_flow_error *error)\n {\n \tint ret;\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tenum rte_fdir_mode fdir_mode = dev->data->dev_conf.fdir_conf.mode;\n+\n+\tif (hw->mac.type != ixgbe_mac_82599EB &&\n+\t\thw->mac.type != ixgbe_mac_X540 &&\n+\t\thw->mac.type != ixgbe_mac_X550 &&\n+\t\thw->mac.type != ixgbe_mac_X550EM_x &&\n+\t\thw->mac.type != ixgbe_mac_X550EM_a)\n+\t\treturn -ENOTSUP;\n \n \tret = ixgbe_parse_fdir_filter_normal(attr, pattern,\n \t\t\t\t\tactions, rule, error);\n \n \tif (!ret)\n-\t\treturn 0;\n+\t\tgoto step_next;\n \n \tret = ixgbe_parse_fdir_filter_tunnel(attr, pattern,\n \t\t\t\t\tactions, rule, error);\n \n-\treturn ret;\n-}\n-\n-static int\n-ixgbe_validate_fdir_filter(struct rte_eth_dev *dev,\n-\t\t\tconst struct rte_flow_attr *attr,\n-\t\t\tconst struct rte_flow_item pattern[],\n-\t\t\tconst struct rte_flow_action actions[],\n-\t\t\tstruct ixgbe_fdir_rule *rule,\n-\t\t\tstruct rte_flow_error *error)\n-{\n-\tint ret = 0;\n-\n-\tenum rte_fdir_mode fdir_mode = dev->data->dev_conf.fdir_conf.mode;\n-\n-\tixgbe_parse_fdir_filter(attr, pattern, actions,\n-\t\t\t\trule, error);\n-\n-\n+step_next:\n \tif (fdir_mode == RTE_FDIR_MODE_NONE ||\n \t    fdir_mode != rule->mode)\n \t\treturn -ENOTSUP;\n-\n \treturn ret;\n }\n \n@@ -2449,7 +2452,7 @@ ixgbe_flow_create(struct rte_eth_dev *dev,\n \t\t\t\tixgbe_flow_mem_ptr, entries);\n \n \tmemset(&ntuple_filter, 0, sizeof(struct rte_eth_ntuple_filter));\n-\tret = ixgbe_parse_ntuple_filter(attr, pattern,\n+\tret = ixgbe_parse_ntuple_filter(dev, attr, pattern,\n \t\t\tactions, &ntuple_filter, error);\n \tif (!ret) {\n \t\tret = ixgbe_add_del_ntuple_filter(dev, &ntuple_filter, TRUE);\n@@ -2469,7 +2472,7 @@ ixgbe_flow_create(struct rte_eth_dev *dev,\n \t}\n \n \tmemset(&ethertype_filter, 0, sizeof(struct rte_eth_ethertype_filter));\n-\tret = ixgbe_parse_ethertype_filter(attr, pattern,\n+\tret = ixgbe_parse_ethertype_filter(dev, attr, pattern,\n \t\t\t\tactions, &ethertype_filter, error);\n \tif (!ret) {\n \t\tret = ixgbe_add_del_ethertype_filter(dev,\n@@ -2491,7 +2494,8 @@ ixgbe_flow_create(struct rte_eth_dev *dev,\n \t}\n \n \tmemset(&syn_filter, 0, sizeof(struct rte_eth_syn_filter));\n-\tret = cons_parse_syn_filter(attr, pattern, actions, &syn_filter, error);\n+\tret = ixgbe_parse_syn_filter(dev, attr, pattern,\n+\t\t\t\tactions, &syn_filter, error);\n \tif (!ret) {\n \t\tret = ixgbe_syn_filter_set(dev, &syn_filter, TRUE);\n \t\tif (!ret) {\n@@ -2511,7 +2515,7 @@ ixgbe_flow_create(struct rte_eth_dev *dev,\n \t}\n \n \tmemset(&fdir_rule, 0, sizeof(struct ixgbe_fdir_rule));\n-\tret = ixgbe_parse_fdir_filter(attr, pattern,\n+\tret = ixgbe_parse_fdir_filter(dev, attr, pattern,\n \t\t\t\tactions, &fdir_rule, error);\n \tif (!ret) {\n \t\t/* A mask cannot be deleted. */\n@@ -2564,7 +2568,7 @@ ixgbe_flow_create(struct rte_eth_dev *dev,\n \t}\n \n \tmemset(&l2_tn_filter, 0, sizeof(struct rte_eth_l2_tunnel_conf));\n-\tret = cons_parse_l2_tn_filter(attr, pattern,\n+\tret = ixgbe_parse_l2_tn_filter(dev, attr, pattern,\n \t\t\t\t\tactions, &l2_tn_filter, error);\n \tif (!ret) {\n \t\tret = ixgbe_dev_l2_tunnel_filter_add(dev, &l2_tn_filter, FALSE);\n@@ -2610,31 +2614,31 @@ ixgbe_flow_validate(__rte_unused struct rte_eth_dev *dev,\n \tint ret;\n \n \tmemset(&ntuple_filter, 0, sizeof(struct rte_eth_ntuple_filter));\n-\tret = ixgbe_parse_ntuple_filter(attr, pattern,\n+\tret = ixgbe_parse_ntuple_filter(dev, attr, pattern,\n \t\t\t\tactions, &ntuple_filter, error);\n \tif (!ret)\n \t\treturn 0;\n \n \tmemset(&ethertype_filter, 0, sizeof(struct rte_eth_ethertype_filter));\n-\tret = ixgbe_parse_ethertype_filter(attr, pattern,\n+\tret = ixgbe_parse_ethertype_filter(dev, attr, pattern,\n \t\t\t\tactions, &ethertype_filter, error);\n \tif (!ret)\n \t\treturn 0;\n \n \tmemset(&syn_filter, 0, sizeof(struct rte_eth_syn_filter));\n-\tret = ixgbe_parse_syn_filter(attr, pattern,\n+\tret = ixgbe_parse_syn_filter(dev, attr, pattern,\n \t\t\t\tactions, &syn_filter, error);\n \tif (!ret)\n \t\treturn 0;\n \n \tmemset(&fdir_rule, 0, sizeof(struct ixgbe_fdir_rule));\n-\tret = ixgbe_validate_fdir_filter(dev, attr, pattern,\n+\tret = ixgbe_parse_fdir_filter(dev, attr, pattern,\n \t\t\t\tactions, &fdir_rule, error);\n \tif (!ret)\n \t\treturn 0;\n \n \tmemset(&l2_tn_filter, 0, sizeof(struct rte_eth_l2_tunnel_conf));\n-\tret = ixgbe_validate_l2_tn_filter(dev, attr, pattern,\n+\tret = ixgbe_parse_l2_tn_filter(dev, attr, pattern,\n \t\t\t\tactions, &l2_tn_filter, error);\n \n \treturn ret;\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "2/2"
    ]
}