Show a patch.

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

{
    "id": 73491,
    "url": "https://patches.dpdk.org/api/patches/73491/?format=api",
    "web_url": "https://patches.dpdk.org/patch/73491/",
    "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"
    },
    "msgid": "<20200708105228.43104-1-zhirun.yan@intel.com>",
    "date": "2020-07-08T10:52:28",
    "name": "net/ice: add support for src MAC filter on FDIR",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "afef5bf45451c523925e37b9b62c55aecbbbe303",
    "submitter": {
        "id": 1154,
        "url": "https://patches.dpdk.org/api/people/1154/?format=api",
        "name": "Yan, Zhirun",
        "email": "zhirun.yan@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/patch/73491/mbox/",
    "series": [
        {
            "id": 10870,
            "url": "https://patches.dpdk.org/api/series/10870/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10870",
            "date": "2020-07-08T10:52:28",
            "name": "net/ice: add support for src MAC filter on FDIR",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/10870/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73491/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/73491/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9675\"; a=\"212675579\"",
            "E=Sophos;i=\"5.75,326,1589266800\"; d=\"scan'208\";a=\"212675579\"",
            "E=Sophos;i=\"5.75,326,1589266800\"; d=\"scan'208\";a=\"268359186\""
        ],
        "From": "Zhirun Yan <zhirun.yan@intel.com>",
        "IronPort-SDR": [
            "\n r/s70x3O88yapvTBp+e+p0Nyr/NKZFgEnhQHWWEsQg1HHfij6lvcYLqy37IfMCsDjedEy8HO5b\n KA/rU1vJbxnQ==",
            "\n IxzDDGzt0gg8cHrKEtctOig5avtLg9Bk3x4esXe/Bm+kBEIuKxhg5j+on6DZYp2nlANUSYjAxB\n Alb5J/ZhLl4A=="
        ],
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-ExtLoop1": "1",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Message-Id": "<20200708105228.43104-1-zhirun.yan@intel.com>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 68B1BA00BE;\n\tWed,  8 Jul 2020 04:58:38 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id F374F1DCE2;\n\tWed,  8 Jul 2020 04:58:37 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by dpdk.org (Postfix) with ESMTP id D7A3D1DC54\n for <dev@dpdk.org>; Wed,  8 Jul 2020 04:58:34 +0200 (CEST)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 07 Jul 2020 19:58:33 -0700",
            "from dpdk-zhirun-dev.sh.intel.com ([10.67.118.152])\n by fmsmga008.fm.intel.com with ESMTP; 07 Jul 2020 19:58:31 -0700"
        ],
        "X-Mailer": "git-send-email 2.17.1",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH] net/ice: add support for src MAC filter on FDIR",
        "Precedence": "list",
        "Date": "Wed,  8 Jul 2020 10:52:28 +0000",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Amp-File-Uploaded": "False",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Cc": "yahui.cao@intel.com, simei.su@intel.com, xiao.w.wang@intel.com,\n dev@dpdk.org, Zhirun Yan <zhirun.yan@intel.com>",
        "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-Post": "<mailto:dev@dpdk.org>",
        "To": "qi.z.zhang@intel.com",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "This patch enables FDIR with src mac filter and change the logic for\nonly supporting ether type field without IP pattern. Application may\nset ether type with IP. It is redundant for flow, ignore ether type\nexcept for ICE_FLTR_PTYPE_NON_IP_L2.\n\nAlso, remove redundant code for checking next_type.\n\nSigned-off-by: Zhirun Yan <zhirun.yan@intel.com>\n---\n drivers/net/ice/ice_fdir_filter.c | 63 +++++++++++++------------------\n 1 file changed, 26 insertions(+), 37 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c\nindex c0f89db83..48d3fdec8 100644\n--- a/drivers/net/ice/ice_fdir_filter.c\n+++ b/drivers/net/ice/ice_fdir_filter.c\n@@ -19,10 +19,10 @@\n #define ICE_FDIR_MAX_QREGION_SIZE\t128\n \n #define ICE_FDIR_INSET_ETH (\\\n-\tICE_INSET_ETHERTYPE)\n+\tICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_ETHERTYPE)\n \n #define ICE_FDIR_INSET_ETH_IPV4 (\\\n-\tICE_INSET_DMAC | \\\n+\tICE_FDIR_INSET_ETH | \\\n \tICE_INSET_IPV4_SRC | ICE_INSET_IPV4_DST | ICE_INSET_IPV4_TOS | \\\n \tICE_INSET_IPV4_TTL | ICE_INSET_IPV4_PROTO)\n \n@@ -1620,9 +1620,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,\n \t\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF\n \t};\n \tuint32_t vtc_flow_cpu;\n-\n-\tenum rte_flow_item_type next_type;\n \tuint16_t ether_type;\n+\tenum rte_flow_item_type next_type;\n \n \tfor (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {\n \t\tif (item->last) {\n@@ -1640,50 +1639,40 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,\n \t\t\teth_mask = item->mask;\n \t\t\tnext_type = (item + 1)->type;\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\trte_flow_error_set(error, EINVAL,\n-\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n-\t\t\t\t\titem, \"NULL eth spec/mask.\");\n-\t\t\t\treturn -rte_errno;\n-\t\t\t}\n-\n \t\t\tif (eth_spec && eth_mask) {\n-\t\t\t\tif (!rte_is_zero_ether_addr(&eth_spec->src) ||\n-\t\t\t\t    !rte_is_zero_ether_addr(&eth_mask->src)) {\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\"Src mac not support\");\n-\t\t\t\t\treturn -rte_errno;\n-\t\t\t\t}\n-\n-\t\t\t\tif (rte_is_broadcast_ether_addr(&eth_mask->dst)) {\n+\t\t\t\tif (!rte_is_zero_ether_addr(&eth_mask->dst)) {\n \t\t\t\t\tinput_set |= ICE_INSET_DMAC;\n \t\t\t\t\trte_memcpy(&filter->input.ext_data.dst_mac,\n-\t\t\t\t\t\t&eth_spec->dst,\n-\t\t\t\t\t\tRTE_ETHER_ADDR_LEN);\n-\t\t\t\t} else if (eth_mask->type == RTE_BE16(0xffff)) {\n+\t\t\t\t\t\t   &eth_spec->dst,\n+\t\t\t\t\t\t   RTE_ETHER_ADDR_LEN);\n+\t\t\t\t}\n+\n+\t\t\t\tif (!rte_is_zero_ether_addr(&eth_mask->src)) {\n+\t\t\t\t\tinput_set |= ICE_INSET_SMAC;\n+\t\t\t\t\trte_memcpy(&filter->input.ext_data.src_mac,\n+\t\t\t\t\t\t   &eth_spec->src,\n+\t\t\t\t\t\t   RTE_ETHER_ADDR_LEN);\n+\t\t\t\t}\n+\n+\t\t\t\t/* Ignore this field except for ICE_FLTR_PTYPE_NON_IP_L2 */\n+\t\t\t\tif (eth_mask->type == RTE_BE16(0xffff) &&\n+\t\t\t\t    next_type == RTE_FLOW_ITEM_TYPE_END) {\n+\t\t\t\t\tinput_set |= ICE_INSET_ETHERTYPE;\n \t\t\t\t\tether_type = rte_be_to_cpu_16(eth_spec->type);\n+\n \t\t\t\t\tif (ether_type == RTE_ETHER_TYPE_IPV4 ||\n-\t\t\t\t\t\tether_type == RTE_ETHER_TYPE_IPV6) {\n+\t\t\t\t\t    ether_type == RTE_ETHER_TYPE_IPV6) {\n \t\t\t\t\t\trte_flow_error_set(error, EINVAL,\n-\t\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n-\t\t\t\t\t\t\titem,\n-\t\t\t\t\t\t\t\"Unsupported ether_type.\");\n+\t\t\t\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t\t\t\t   item,\n+\t\t\t\t\t\t\t\t   \"Unsupported ether_type.\");\n \t\t\t\t\t\treturn -rte_errno;\n \t\t\t\t\t}\n \n-\t\t\t\t\tinput_set |= ICE_INSET_ETHERTYPE;\n \t\t\t\t\trte_memcpy(&filter->input.ext_data.ether_type,\n-\t\t\t\t\t\t&eth_spec->type,\n-\t\t\t\t\t\tsizeof(eth_spec->type));\n+\t\t\t\t\t\t   &eth_spec->type,\n+\t\t\t\t\t\t   sizeof(eth_spec->type));\n \t\t\t\t\tflow_type = ICE_FLTR_PTYPE_NON_IP_L2;\n-\t\t\t\t} else {\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\"Invalid dst mac addr mask or ethertype mask\");\n \t\t\t\t}\n \t\t\t}\n \t\t\tbreak;\n",
    "prefixes": []
}