get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64741,
    "url": "https://patches.dpdk.org/api/patches/64741/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200116120823.58942-1-taox.zhu@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": "<20200116120823.58942-1-taox.zhu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200116120823.58942-1-taox.zhu@intel.com",
    "date": "2020-01-16T12:08:23",
    "name": "[v5] net/i40e: add PF MDD event handler",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "17fc1a2737f0ba80c686693aead607a870978c92",
    "submitter": {
        "id": 1368,
        "url": "https://patches.dpdk.org/api/people/1368/?format=api",
        "name": "Zhu, TaoX",
        "email": "taox.zhu@intel.com"
    },
    "delegate": {
        "id": 31221,
        "url": "https://patches.dpdk.org/api/users/31221/?format=api",
        "username": "yexl",
        "first_name": "xiaolong",
        "last_name": "ye",
        "email": "xiaolong.ye@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200116120823.58942-1-taox.zhu@intel.com/mbox/",
    "series": [
        {
            "id": 8146,
            "url": "https://patches.dpdk.org/api/series/8146/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=8146",
            "date": "2020-01-16T12:08:23",
            "name": "[v5] net/i40e: add PF MDD event handler",
            "version": 5,
            "mbox": "https://patches.dpdk.org/series/8146/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/64741/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/64741/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 3BA8CA0352;\n\tThu, 16 Jan 2020 04:33:14 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8DD5C1C13B;\n\tThu, 16 Jan 2020 04:33:13 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by dpdk.org (Postfix) with ESMTP id 5849A1C024\n for <dev@dpdk.org>; Thu, 16 Jan 2020 04:33:10 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 15 Jan 2020 19:33:10 -0800",
            "from unknown (HELO localhost.localdomain) ([10.239.250.16])\n by fmsmga001.fm.intel.com with ESMTP; 15 Jan 2020 19:33:05 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.70,324,1574150400\"; d=\"scan'208\";a=\"256077608\"",
        "From": "taox.zhu@intel.com",
        "To": "beilei.xing@intel.com,\n\tqi.z.zhang@intel.com",
        "Cc": "dev@dpdk.org, qiming.yang@intel.com, xiaolong.ye@intel.com,\n Zhu Tao <taox.zhu@intel.com>",
        "Date": "Thu, 16 Jan 2020 12:08:23 +0000",
        "Message-Id": "<20200116120823.58942-1-taox.zhu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191209135928.31697-1-taox.zhu@intel.com>",
        "References": "<20191209135928.31697-1-taox.zhu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5] net/i40e: add PF MDD event handler",
        "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": "From: Zhu Tao <taox.zhu@intel.com>\n\nadd warning and counter to handle the maliciouse driver detection event.\nWhen the hardware determines that a VF has maliciouse driver, this VF\nwill become unworkable, the PF records and gives a warning message.\n\nSigned-off-by: Zhu Tao <taox.zhu@intel.com>\nAcked-by: Qiming Yang <qiming.yang@intel.com>\n---\n doc/guides/nics/i40e.rst               |  1 +\n doc/guides/rel_notes/release_20_02.rst |  4 +-\n drivers/net/i40e/i40e_ethdev.c         | 89 +++++++++++++++++++++++++-\n drivers/net/i40e/i40e_ethdev.h         |  1 +\n 4 files changed, 92 insertions(+), 3 deletions(-)\n\nv5:\n- Change commit message\nv4:\n- Change commit message\n- Rebase doc/guides/rel_notes/release_20_02.rst\nv3:\n- Change commit message",
    "diff": "diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst\nindex c7c34b62f..2bf11e8ca 100644\n--- a/doc/guides/nics/i40e.rst\n+++ b/doc/guides/nics/i40e.rst\n@@ -43,6 +43,7 @@ Features of the i40e PMD are:\n - Dynamic Device Personalization (DDP)\n - Queue region configuration\n - Virtual Function Port Representors\n+- Malicious Device Drive event catch and notify\n \n Prerequisites\n -------------\ndiff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst\nindex 1e83e659a..a39f22221 100644\n--- a/doc/guides/rel_notes/release_20_02.rst\n+++ b/doc/guides/rel_notes/release_20_02.rst\n@@ -66,11 +66,13 @@ New Features\n \n   * Added support for RSS using L3/L4 source/destination only.\n \n-* **Updated i40e driver to support L2TPv3 over IP flows.**\n+* **Updated i40e driver.**\n \n   Updated the i40e PMD to support L2TPv3 over IP profiles which can be\n   programmed by the dynamic device personalization (DDP) process.\n \n+  Added PF support Malicious Device Drive event catch and notify.\n+\n * **Updated testpmd to support L2TPv3 over IP flows.**\n \n   Added support for L2TPv3 over IP rte_flow patterns to the testpmd\ndiff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex afb6f554b..95bfed4d9 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -6760,6 +6760,87 @@ i40e_dev_handle_aq_msg(struct rte_eth_dev *dev)\n \trte_free(info.msg_buf);\n }\n \n+static void\n+i40e_handle_mdd_event(struct rte_eth_dev *dev)\n+{\n+\tstruct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n+\tbool mdd_detected = false;\n+\tstruct i40e_pf_vf *vf;\n+\tuint32_t reg;\n+\tint i;\n+\n+\t/* find what triggered the MDD event */\n+\treg = I40E_READ_REG(hw, I40E_GL_MDET_TX);\n+\tif (reg & I40E_GL_MDET_TX_VALID_MASK) {\n+\t\tuint8_t pf_num = (reg & I40E_GL_MDET_TX_PF_NUM_MASK) >>\n+\t\t\t\tI40E_GL_MDET_TX_PF_NUM_SHIFT;\n+\t\tuint16_t vf_num = (reg & I40E_GL_MDET_TX_VF_NUM_MASK) >>\n+\t\t\t\tI40E_GL_MDET_TX_VF_NUM_SHIFT;\n+\t\tuint8_t event = (reg & I40E_GL_MDET_TX_EVENT_MASK) >>\n+\t\t\t\tI40E_GL_MDET_TX_EVENT_SHIFT;\n+\t\tuint16_t queue = ((reg & I40E_GL_MDET_TX_QUEUE_MASK) >>\n+\t\t\t\tI40E_GL_MDET_TX_QUEUE_SHIFT) -\n+\t\t\t\t\thw->func_caps.base_queue;\n+\t\tPMD_DRV_LOG(WARNING, \"Malicious Driver Detection event 0x%02x on TX \"\n+\t\t\t\"queue %d PF number 0x%02x VF number 0x%02x device %s\\n\",\n+\t\t\t\tevent, queue, pf_num, vf_num, dev->data->name);\n+\t\tI40E_WRITE_REG(hw, I40E_GL_MDET_TX, 0xffffffff);\n+\t\tmdd_detected = true;\n+\t}\n+\treg = I40E_READ_REG(hw, I40E_GL_MDET_RX);\n+\tif (reg & I40E_GL_MDET_RX_VALID_MASK) {\n+\t\tuint8_t func = (reg & I40E_GL_MDET_RX_FUNCTION_MASK) >>\n+\t\t\t\tI40E_GL_MDET_RX_FUNCTION_SHIFT;\n+\t\tuint8_t event = (reg & I40E_GL_MDET_RX_EVENT_MASK) >>\n+\t\t\t\tI40E_GL_MDET_RX_EVENT_SHIFT;\n+\t\tuint16_t queue = ((reg & I40E_GL_MDET_RX_QUEUE_MASK) >>\n+\t\t\t\tI40E_GL_MDET_RX_QUEUE_SHIFT) -\n+\t\t\t\t\thw->func_caps.base_queue;\n+\n+\t\tPMD_DRV_LOG(WARNING, \"Malicious Driver Detection event 0x%02x on RX \"\n+\t\t\t\t\"queue %d of function 0x%02x device %s\\n\",\n+\t\t\t\t\tevent, queue, func, dev->data->name);\n+\t\tI40E_WRITE_REG(hw, I40E_GL_MDET_RX, 0xffffffff);\n+\t\tmdd_detected = true;\n+\t}\n+\n+\tif (mdd_detected) {\n+\t\treg = I40E_READ_REG(hw, I40E_PF_MDET_TX);\n+\t\tif (reg & I40E_PF_MDET_TX_VALID_MASK) {\n+\t\t\tI40E_WRITE_REG(hw, I40E_PF_MDET_TX, 0xFFFF);\n+\t\t\tPMD_DRV_LOG(WARNING, \"TX driver issue detected on PF\\n\");\n+\t\t}\n+\t\treg = I40E_READ_REG(hw, I40E_PF_MDET_RX);\n+\t\tif (reg & I40E_PF_MDET_RX_VALID_MASK) {\n+\t\t\tI40E_WRITE_REG(hw, I40E_PF_MDET_RX, 0xFFFF);\n+\t\t\tPMD_DRV_LOG(WARNING, \"RX driver issue detected on PF\\n\");\n+\t\t}\n+\t}\n+\n+\t/* see if one of the VFs needs its hand slapped */\n+\tfor (i = 0; i < pf->vf_num && mdd_detected; i++) {\n+\t\tvf = &pf->vfs[i];\n+\t\treg = I40E_READ_REG(hw, I40E_VP_MDET_TX(i));\n+\t\tif (reg & I40E_VP_MDET_TX_VALID_MASK) {\n+\t\t\tI40E_WRITE_REG(hw, I40E_VP_MDET_TX(i), 0xFFFF);\n+\t\t\tvf->num_mdd_events++;\n+\t\t\tPMD_DRV_LOG(WARNING, \"TX driver issue detected on VF %d %-\"\n+\t\t\t\t\tPRIu64 \"times\\n\",\n+\t\t\t\t\ti, vf->num_mdd_events);\n+\t\t}\n+\n+\t\treg = I40E_READ_REG(hw, I40E_VP_MDET_RX(i));\n+\t\tif (reg & I40E_VP_MDET_RX_VALID_MASK) {\n+\t\t\tI40E_WRITE_REG(hw, I40E_VP_MDET_RX(i), 0xFFFF);\n+\t\t\tvf->num_mdd_events++;\n+\t\t\tPMD_DRV_LOG(WARNING, \"RX driver issue detected on VF %d %-\"\n+\t\t\t\t\tPRIu64 \"times\\n\",\n+\t\t\t\t\ti, vf->num_mdd_events);\n+\t\t}\n+\t}\n+}\n+\n /**\n  * Interrupt handler triggered by NIC  for handling\n  * specific interrupt.\n@@ -6792,8 +6873,10 @@ i40e_dev_interrupt_handler(void *param)\n \t}\n \tif (icr0 & I40E_PFINT_ICR0_ECC_ERR_MASK)\n \t\tPMD_DRV_LOG(ERR, \"ICR0: unrecoverable ECC error\");\n-\tif (icr0 & I40E_PFINT_ICR0_MAL_DETECT_MASK)\n+\tif (icr0 & I40E_PFINT_ICR0_MAL_DETECT_MASK) {\n \t\tPMD_DRV_LOG(ERR, \"ICR0: malicious programming detected\");\n+\t\ti40e_handle_mdd_event(dev);\n+\t}\n \tif (icr0 & I40E_PFINT_ICR0_GRST_MASK)\n \t\tPMD_DRV_LOG(INFO, \"ICR0: global reset requested\");\n \tif (icr0 & I40E_PFINT_ICR0_PCI_EXCEPTION_MASK)\n@@ -6837,8 +6920,10 @@ i40e_dev_alarm_handler(void *param)\n \t\tgoto done;\n \tif (icr0 & I40E_PFINT_ICR0_ECC_ERR_MASK)\n \t\tPMD_DRV_LOG(ERR, \"ICR0: unrecoverable ECC error\");\n-\tif (icr0 & I40E_PFINT_ICR0_MAL_DETECT_MASK)\n+\tif (icr0 & I40E_PFINT_ICR0_MAL_DETECT_MASK) {\n \t\tPMD_DRV_LOG(ERR, \"ICR0: malicious programming detected\");\n+\t\ti40e_handle_mdd_event(dev);\n+\t}\n \tif (icr0 & I40E_PFINT_ICR0_GRST_MASK)\n \t\tPMD_DRV_LOG(INFO, \"ICR0: global reset requested\");\n \tif (icr0 & I40E_PFINT_ICR0_PCI_EXCEPTION_MASK)\ndiff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h\nindex bba2b83b4..370e6298f 100644\n--- a/drivers/net/i40e/i40e_ethdev.h\n+++ b/drivers/net/i40e/i40e_ethdev.h\n@@ -426,6 +426,7 @@ struct i40e_pf_vf {\n \t/* version of the virtchnl from VF */\n \tstruct virtchnl_version_info version;\n \tuint32_t request_caps; /* offload caps requested from VF */\n+\tuint64_t num_mdd_events; /* num of mdd events detected */\n \n \t/*\n \t * Variables for store the arrival timestamp of VF messages.\n",
    "prefixes": [
        "v5"
    ]
}