get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 75442,
    "url": "http://patchwork.dpdk.org/api/patches/75442/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200812005753.467362-1-haiyue.wang@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20200812005753.467362-1-haiyue.wang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200812005753.467362-1-haiyue.wang@intel.com",
    "date": "2020-08-12T00:57:53",
    "name": "[v2] net/ice: optimize the FlexiMD hardware check",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "59988a9112a62c8a540293358e57fc08d85bf47a",
    "submitter": {
        "id": 1044,
        "url": "http://patchwork.dpdk.org/api/people/1044/?format=api",
        "name": "Wang, Haiyue",
        "email": "haiyue.wang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patchwork.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200812005753.467362-1-haiyue.wang@intel.com/mbox/",
    "series": [
        {
            "id": 11608,
            "url": "http://patchwork.dpdk.org/api/series/11608/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=11608",
            "date": "2020-08-12T00:57:53",
            "name": "[v2] net/ice: optimize the FlexiMD hardware check",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/11608/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/75442/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/75442/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id BB9D2A04E4;\n\tWed, 12 Aug 2020 03:07:53 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0A07E1C026;\n\tWed, 12 Aug 2020 03:07:53 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by dpdk.org (Postfix) with ESMTP id C4C081BFF3\n for <dev@dpdk.org>; Wed, 12 Aug 2020 03:07:51 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 11 Aug 2020 18:07:50 -0700",
            "from npg-dpdk-haiyue-3.sh.intel.com ([10.67.118.248])\n by orsmga002.jf.intel.com with ESMTP; 11 Aug 2020 18:07:46 -0700"
        ],
        "IronPort-SDR": [
            "\n WXguT8cnhGEhjMLbFTEtMkBDOnlIgdxXyTmq0frooclXgzVHKsnkYdQDPZOFRv+mYPHmIDwnio\n Q/dv/zf9juzw==",
            "\n IeKrFWnMl30KmroZMa4EDMVEqbdzelwTiQSyYw7CVmFrf/BgWGP3dJmG3A+J2jUauwc02GJDDM\n /X8IxbWCaB9Q=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9710\"; a=\"141706475\"",
            "E=Sophos;i=\"5.76,302,1592895600\"; d=\"scan'208\";a=\"141706475\"",
            "E=Sophos;i=\"5.76,302,1592895600\"; d=\"scan'208\";a=\"308568179\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Haiyue Wang <haiyue.wang@intel.com>",
        "To": "dev@dpdk.org,\n\tqiming.yang@intel.com,\n\tqi.z.zhang@intel.com",
        "Cc": "junfeng.guo@intel.com,\n\tHaiyue Wang <haiyue.wang@intel.com>",
        "Date": "Wed, 12 Aug 2020 08:57:53 +0800",
        "Message-Id": "<20200812005753.467362-1-haiyue.wang@intel.com>",
        "X-Mailer": "git-send-email 2.28.0",
        "In-Reply-To": "<20200811152044.462128-1-haiyue.wang@intel.com>",
        "References": "<20200811152044.462128-1-haiyue.wang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2] net/ice: optimize the FlexiMD hardware check",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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": "The Flexible Metadata #4 and #5 in the Rx Flex Descriptor are defined to\nextract the protocol specified fields or its offset. Its function relays\non the DDP package support in hardware.\n\nOptimize to only check the hardware support when the user specifies the\n'proto_xtr' devargs. And not require all the types need to be support in\nhardware, otherwise if new protocol extraction type is introduced, it is\nhard to maintain the compatibility. Just check the type support in need.\n\nAnd the protocol IDs are 8 bits length, so the uint8_t is the right type\nto be used. Also introduce the 'opcode' variable to specify the metadata\nextraction type: it can be protocol fields or offset report.\n\nSigned-off-by: Haiyue Wang <haiyue.wang@intel.com>\n---\nv2: update the commit title and message.\n---\n drivers/net/ice/ice_ethdev.c | 66 ++++++++++++++++++++++--------------\n drivers/net/ice/ice_ethdev.h |  1 +\n 2 files changed, 42 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c\nindex 8d435e889..d67390f29 100644\n--- a/drivers/net/ice/ice_ethdev.c\n+++ b/drivers/net/ice/ice_ethdev.c\n@@ -47,6 +47,8 @@ struct proto_xtr_ol_flag {\n \tbool required;\n };\n \n+static bool ice_proto_xtr_hw_support[PROTO_XTR_MAX];\n+\n static struct proto_xtr_ol_flag ice_proto_xtr_ol_flag_params[] = {\n \t[PROTO_XTR_VLAN] = {\n \t\t.param = { .name = \"ice_dynflag_proto_xtr_vlan\" },\n@@ -536,25 +538,36 @@ handle_proto_xtr_arg(__rte_unused const char *key, const char *value,\n \treturn 0;\n }\n \n-static bool\n-ice_proto_xtr_support(struct ice_hw *hw)\n+static void\n+ice_check_proto_xtr_support(struct ice_hw *hw)\n {\n #define FLX_REG(val, fld, idx) \\\n \t(((val) & GLFLXP_RXDID_FLX_WRD_##idx##_##fld##_M) >> \\\n \t GLFLXP_RXDID_FLX_WRD_##idx##_##fld##_S)\n \tstatic struct {\n \t\tuint32_t rxdid;\n-\t\tuint16_t protid_0;\n-\t\tuint16_t protid_1;\n+\t\tuint8_t opcode;\n+\t\tuint8_t protid_0;\n+\t\tuint8_t protid_1;\n \t} xtr_sets[] = {\n-\t\t{ ICE_RXDID_COMMS_AUX_VLAN, ICE_PROT_EVLAN_O, ICE_PROT_VLAN_O },\n-\t\t{ ICE_RXDID_COMMS_AUX_IPV4, ICE_PROT_IPV4_OF_OR_S,\n-\t\t  ICE_PROT_IPV4_OF_OR_S },\n-\t\t{ ICE_RXDID_COMMS_AUX_IPV6, ICE_PROT_IPV6_OF_OR_S,\n-\t\t  ICE_PROT_IPV6_OF_OR_S },\n-\t\t{ ICE_RXDID_COMMS_AUX_IPV6_FLOW, ICE_PROT_IPV6_OF_OR_S,\n-\t\t  ICE_PROT_IPV6_OF_OR_S },\n-\t\t{ ICE_RXDID_COMMS_AUX_TCP, ICE_PROT_TCP_IL, ICE_PROT_ID_INVAL },\n+\t\t[PROTO_XTR_VLAN] = { ICE_RXDID_COMMS_AUX_VLAN,\n+\t\t\t\t     ICE_RX_OPC_EXTRACT,\n+\t\t\t\t     ICE_PROT_EVLAN_O, ICE_PROT_VLAN_O},\n+\t\t[PROTO_XTR_IPV4] = { ICE_RXDID_COMMS_AUX_IPV4,\n+\t\t\t\t     ICE_RX_OPC_EXTRACT,\n+\t\t\t\t     ICE_PROT_IPV4_OF_OR_S,\n+\t\t\t\t     ICE_PROT_IPV4_OF_OR_S },\n+\t\t[PROTO_XTR_IPV6] = { ICE_RXDID_COMMS_AUX_IPV6,\n+\t\t\t\t     ICE_RX_OPC_EXTRACT,\n+\t\t\t\t     ICE_PROT_IPV6_OF_OR_S,\n+\t\t\t\t     ICE_PROT_IPV6_OF_OR_S },\n+\t\t[PROTO_XTR_IPV6_FLOW] = { ICE_RXDID_COMMS_AUX_IPV6_FLOW,\n+\t\t\t\t\t  ICE_RX_OPC_EXTRACT,\n+\t\t\t\t\t  ICE_PROT_IPV6_OF_OR_S,\n+\t\t\t\t\t  ICE_PROT_IPV6_OF_OR_S },\n+\t\t[PROTO_XTR_TCP] = { ICE_RXDID_COMMS_AUX_TCP,\n+\t\t\t\t    ICE_RX_OPC_EXTRACT,\n+\t\t\t\t    ICE_PROT_TCP_IL, ICE_PROT_ID_INVAL },\n \t};\n \tuint32_t i;\n \n@@ -565,21 +578,19 @@ ice_proto_xtr_support(struct ice_hw *hw)\n \t\tif (xtr_sets[i].protid_0 != ICE_PROT_ID_INVAL) {\n \t\t\tv = ICE_READ_REG(hw, GLFLXP_RXDID_FLX_WRD_4(rxdid));\n \n-\t\t\tif (FLX_REG(v, PROT_MDID, 4) != xtr_sets[i].protid_0 ||\n-\t\t\t    FLX_REG(v, RXDID_OPCODE, 4) != ICE_RX_OPC_EXTRACT)\n-\t\t\t\treturn false;\n+\t\t\tif (FLX_REG(v, PROT_MDID, 4) == xtr_sets[i].protid_0 &&\n+\t\t\t    FLX_REG(v, RXDID_OPCODE, 4) == xtr_sets[i].opcode)\n+\t\t\t\tice_proto_xtr_hw_support[i] = true;\n \t\t}\n \n \t\tif (xtr_sets[i].protid_1 != ICE_PROT_ID_INVAL) {\n \t\t\tv = ICE_READ_REG(hw, GLFLXP_RXDID_FLX_WRD_5(rxdid));\n \n-\t\t\tif (FLX_REG(v, PROT_MDID, 5) != xtr_sets[i].protid_1 ||\n-\t\t\t    FLX_REG(v, RXDID_OPCODE, 5) != ICE_RX_OPC_EXTRACT)\n-\t\t\t\treturn false;\n+\t\t\tif (FLX_REG(v, PROT_MDID, 5) == xtr_sets[i].protid_1 &&\n+\t\t\t    FLX_REG(v, RXDID_OPCODE, 5) == xtr_sets[i].opcode)\n+\t\t\t\tice_proto_xtr_hw_support[i] = true;\n \t\t}\n \t}\n-\n-\treturn true;\n }\n \n static int\n@@ -1416,11 +1427,6 @@ ice_init_proto_xtr(struct rte_eth_dev *dev)\n \tint offset;\n \tuint16_t i;\n \n-\tif (!ice_proto_xtr_support(hw)) {\n-\t\tPMD_DRV_LOG(NOTICE, \"Protocol extraction is not supported\");\n-\t\treturn;\n-\t}\n-\n \tpf->proto_xtr = rte_zmalloc(NULL, pf->lan_nb_qps, 0);\n \tif (unlikely(pf->proto_xtr == NULL)) {\n \t\tPMD_DRV_LOG(ERR, \"No memory for setting up protocol extraction table\");\n@@ -1443,6 +1449,8 @@ ice_init_proto_xtr(struct rte_eth_dev *dev)\n \tif (likely(!proto_xtr_enable))\n \t\treturn;\n \n+\tice_check_proto_xtr_support(hw);\n+\n \toffset = rte_mbuf_dynfield_register(&ice_proto_xtr_metadata_param);\n \tif (unlikely(offset == -1)) {\n \t\tPMD_DRV_LOG(ERR,\n@@ -1462,6 +1470,14 @@ ice_init_proto_xtr(struct rte_eth_dev *dev)\n \t\tif (!ol_flag->required)\n \t\t\tcontinue;\n \n+\t\tif (!ice_proto_xtr_hw_support[i]) {\n+\t\t\tPMD_DRV_LOG(ERR,\n+\t\t\t\t    \"Protocol extraction type %u is not supported in hardware\",\n+\t\t\t\t    i);\n+\t\t\trte_net_ice_dynfield_proto_xtr_metadata_offs = -1;\n+\t\t\tbreak;\n+\t\t}\n+\n \t\toffset = rte_mbuf_dynflag_register(&ol_flag->param);\n \t\tif (unlikely(offset == -1)) {\n \t\t\tPMD_DRV_LOG(ERR,\ndiff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h\nindex 393dfeab1..06b9b8683 100644\n--- a/drivers/net/ice/ice_ethdev.h\n+++ b/drivers/net/ice/ice_ethdev.h\n@@ -262,6 +262,7 @@ enum proto_xtr_type {\n \tPROTO_XTR_IPV6,\n \tPROTO_XTR_IPV6_FLOW,\n \tPROTO_XTR_TCP,\n+\tPROTO_XTR_MAX /* The last one */\n };\n \n enum ice_fdir_tunnel_type {\n",
    "prefixes": [
        "v2"
    ]
}