Show a patch.

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

{
    "id": 73358,
    "url": "https://patches.dpdk.org/api/patches/73358/?format=api",
    "web_url": "https://patches.dpdk.org/patch/73358/",
    "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": "<1594092075-389670-1-git-send-email-simei.su@intel.com>",
    "date": "2020-07-07T03:21:15",
    "name": "[v2] net/ice: add support for ether type filter on FDIR",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "dbebc0b4c18cd30efc907d5f089a5ea2a3fa6ec8",
    "submitter": {
        "id": 1298,
        "url": "https://patches.dpdk.org/api/people/1298/?format=api",
        "name": "Simei Su",
        "email": "simei.su@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/73358/mbox/",
    "series": [
        {
            "id": 10831,
            "url": "https://patches.dpdk.org/api/series/10831/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10831",
            "date": "2020-07-07T03:21:15",
            "name": "[v2] net/ice: add support for ether type filter on FDIR",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/10831/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73358/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/73358/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "References": "<1591876980-168031-1-git-send-email-simei.su@intel.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9674\"; a=\"209055143\"",
            "E=Sophos;i=\"5.75,321,1589266800\"; d=\"scan'208\";a=\"209055143\"",
            "E=Sophos;i=\"5.75,321,1589266800\"; d=\"scan'208\";a=\"305508054\""
        ],
        "From": "Simei Su <simei.su@intel.com>",
        "IronPort-SDR": [
            "\n ZmTiM4EC2YAnOHsN/vvTAgesSGnAIT2JTQXo2KchASuOjKzqer26BMgrCdYsOhrjW6ymKXTgu1\n /XX8wLm3ux9A==",
            "\n xK9vBEbuyc9UndkrybB+O9YKg7XwGjG9uR9zUQnjzPOOTI8QfcoLENIvu/QIY0MZRI+ZM3PZOo\n AJNROnxciMrw=="
        ],
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-ExtLoop1": "1",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1594092075-389670-1-git-send-email-simei.su@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 477ECA00BE;\n\tTue,  7 Jul 2020 05:22:24 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2A5091DD3B;\n\tTue,  7 Jul 2020 05:22:24 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n by dpdk.org (Postfix) with ESMTP id 1B3291DC3E\n for <dev@dpdk.org>; Tue,  7 Jul 2020 05:22:22 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 06 Jul 2020 20:22:18 -0700",
            "from unknown (HELO npg-dpdk-cvl-simeisu-118d193.sh.intel.com)\n ([10.67.110.178])\n by fmsmga004.fm.intel.com with ESMTP; 06 Jul 2020 20:22:16 -0700"
        ],
        "X-Mailer": "git-send-email 1.8.3.1",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH v2] net/ice: add support for ether type filter on\n\tFDIR",
        "Precedence": "list",
        "Date": "Tue,  7 Jul 2020 11:21:15 +0800",
        "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": "dev@dpdk.org,\n\tyahui.cao@intel.com,\n\tSimei Su <simei.su@intel.com>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "In-Reply-To": "<1591876980-168031-1-git-send-email-simei.su@intel.com>",
        "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,\n\tbeilei.xing@intel.com",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "This patch enables FDIR with input set ethertype.\n\nSigned-off-by: Simei Su <simei.su@intel.com>\n---\n\nv2:\n* Refine ether layer judgement logic.\n---\n drivers/net/ice/ice_fdir_filter.c | 51 ++++++++++++++++++++++++++++++++-------\n 1 file changed, 42 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c\nindex c3f23a0..93197dd 100644\n--- a/drivers/net/ice/ice_fdir_filter.c\n+++ b/drivers/net/ice/ice_fdir_filter.c\n@@ -18,6 +18,9 @@\n \n #define ICE_FDIR_MAX_QREGION_SIZE\t128\n \n+#define ICE_FDIR_INSET_ETH (\\\n+\tICE_INSET_ETHERTYPE)\n+\n #define ICE_FDIR_INSET_ETH_IPV4 (\\\n \tICE_INSET_DMAC | \\\n \tICE_INSET_IPV4_SRC | ICE_INSET_IPV4_DST | ICE_INSET_IPV4_TOS | \\\n@@ -102,6 +105,7 @@\n };\n \n static struct ice_pattern_match_item ice_fdir_pattern_comms[] = {\n+\t{pattern_ethertype,\t       ICE_FDIR_INSET_ETH,\t\t     ICE_INSET_NONE},\n \t{pattern_eth_ipv4,             ICE_FDIR_INSET_ETH_IPV4,              ICE_INSET_NONE},\n \t{pattern_eth_ipv4_udp,         ICE_FDIR_INSET_ETH_IPV4_UDP,          ICE_INSET_NONE},\n \t{pattern_eth_ipv4_tcp,         ICE_FDIR_INSET_ETH_IPV4_TCP,          ICE_INSET_NONE},\n@@ -894,6 +898,7 @@\n \t};\n \tstatic const struct ice_inset_map ice_inset_map[] = {\n \t\t{ICE_INSET_DMAC, ICE_FLOW_FIELD_IDX_ETH_DA},\n+\t\t{ICE_INSET_ETHERTYPE, ICE_FLOW_FIELD_IDX_ETH_TYPE},\n \t\t{ICE_INSET_IPV4_SRC, ICE_FLOW_FIELD_IDX_IPV4_SA},\n \t\t{ICE_INSET_IPV4_DST, ICE_FLOW_FIELD_IDX_IPV4_DA},\n \t\t{ICE_INSET_IPV4_TOS, ICE_FLOW_FIELD_IDX_IPV4_DSCP},\n@@ -1008,6 +1013,9 @@\n \t\telse\n \t\t\tPMD_DRV_LOG(ERR, \"not supported tunnel type.\");\n \t\tbreak;\n+\tcase ICE_FLTR_PTYPE_NON_IP_L2:\n+\t\tICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_ETH_NON_IP);\n+\t\tbreak;\n \tdefault:\n \t\tPMD_DRV_LOG(ERR, \"not supported filter type.\");\n \t\tbreak;\n@@ -1613,6 +1621,8 @@\n \t};\n \tuint32_t vtc_flow_cpu;\n \n+\tenum rte_flow_item_type next_type;\n+\tuint16_t ether_type;\n \n \tfor (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {\n \t\tif (item->last) {\n@@ -1628,6 +1638,15 @@\n \t\tcase RTE_FLOW_ITEM_TYPE_ETH:\n \t\t\teth_spec = item->spec;\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@@ -1639,18 +1658,32 @@\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_broadcast_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\tether_type = rte_be_to_cpu_16(eth_spec->type);\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\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\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\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 mac addr mask\");\n-\t\t\t\t\treturn -rte_errno;\n-\t\t\t\t}\n-\n-\t\t\t\tinput_set |= ICE_INSET_DMAC;\n-\t\t\t\trte_memcpy(&filter->input.ext_data.dst_mac,\n-\t\t\t\t\t   &eth_spec->dst,\n-\t\t\t\t\t   RTE_ETHER_ADDR_LEN);\n+\t\t\t\t\t\t\"Invalid dst mac addr mask or ethertype mask\");\n \t\t\t}\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_IPV4:\n",
    "prefixes": [
        "v2"
    ]
}