get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 918400,
    "url": "http://patchwork.ozlabs.org/api/patches/918400/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180522154429.80364.17986.stgit@ahduyck-green-test.jf.intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20180522154429.80364.17986.stgit@ahduyck-green-test.jf.intel.com>",
    "list_archive_url": null,
    "date": "2018-05-22T15:44:29",
    "name": "[next-queue] ixgbevf: Fix coexistence of malicious driver detection with XDP",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "bfb22e60d6aa1807a7b3ddf2671c762aa5855b36",
    "submitter": {
        "id": 251,
        "url": "http://patchwork.ozlabs.org/api/people/251/?format=api",
        "name": "Duyck, Alexander H",
        "email": "alexander.h.duyck@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180522154429.80364.17986.stgit@ahduyck-green-test.jf.intel.com/mbox/",
    "series": [
        {
            "id": 45904,
            "url": "http://patchwork.ozlabs.org/api/series/45904/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=45904",
            "date": "2018-05-22T15:44:29",
            "name": "[next-queue] ixgbevf: Fix coexistence of malicious driver detection with XDP",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/45904/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/918400/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/918400/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 40r0Wt680bz9s0y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 23 May 2018 01:52:10 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B62FC8795A;\n\tTue, 22 May 2018 15:52:08 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id TRRwOOLDkHzc; Tue, 22 May 2018 15:52:07 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 57C60879A9;\n\tTue, 22 May 2018 15:52:07 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id B2E751BFFC3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 22 May 2018 15:52:05 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id AE86826C70\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 22 May 2018 15:52:05 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id l9sVj4L+XBDj for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 22 May 2018 15:52:04 +0000 (UTC)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby silver.osuosl.org (Postfix) with ESMTPS id B21BE26B6C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 22 May 2018 15:52:04 +0000 (UTC)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t22 May 2018 08:52:04 -0700",
            "from ahduyck-green-test.jf.intel.com ([10.166.244.179])\n\tby orsmga008.jf.intel.com with ESMTP; 22 May 2018 08:52:04 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.49,430,1520924400\"; d=\"scan'208\";a=\"43325229\"",
        "From": "Alexander Duyck <alexander.h.duyck@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Tue, 22 May 2018 11:44:29 -0400",
        "Message-ID": "<20180522154429.80364.17986.stgit@ahduyck-green-test.jf.intel.com>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [next-queue PATCH] ixgbevf: Fix coexistence of\n\tmalicious driver detection with XDP",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.24",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "In the case of the VF driver it is supposed to provide a context descriptor\nthat allows us to provide information about the header offsets inside of\nthe frame. However in the case of XDP we don't really have any of that\ninformation since the data is minimally processed. As a result we were\nseeing malicious driver detection (MDD) events being triggered when the PF\nhad that functionality enabled.\n\nTo address this I have added a bit of new code that will \"prime\" the XDP\nring by providing one context descriptor that assumes the minimal setup of\nan Ethernet frame which is an L2 header length of 14. With just that we can\nprovide enough information to make the hardware happy so that we don't\ntrigger MDD events.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\n---\n drivers/net/ethernet/intel/ixgbevf/ixgbevf.h      |    1 +\n drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |   36 +++++++++++++++++----\n 2 files changed, 30 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\nindex 70c7568..56a1031 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\n@@ -76,6 +76,7 @@ enum ixgbevf_ring_state_t {\n \t__IXGBEVF_TX_DETECT_HANG,\n \t__IXGBEVF_HANG_CHECK_ARMED,\n \t__IXGBEVF_TX_XDP_RING,\n+\t__IXGBEVF_TX_XDP_RING_PRIMED,\n };\n \n #define ring_is_xdp(ring) \\\ndiff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\nindex c298614..e2a8a03 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n@@ -991,24 +991,45 @@ static int ixgbevf_xmit_xdp_ring(struct ixgbevf_ring *ring,\n \t\treturn IXGBEVF_XDP_CONSUMED;\n \n \t/* record the location of the first descriptor for this packet */\n-\ttx_buffer = &ring->tx_buffer_info[ring->next_to_use];\n-\ttx_buffer->bytecount = len;\n-\ttx_buffer->gso_segs = 1;\n-\ttx_buffer->protocol = 0;\n-\n \ti = ring->next_to_use;\n-\ttx_desc = IXGBEVF_TX_DESC(ring, i);\n+\ttx_buffer = &ring->tx_buffer_info[i];\n \n \tdma_unmap_len_set(tx_buffer, len, len);\n \tdma_unmap_addr_set(tx_buffer, dma, dma);\n \ttx_buffer->data = xdp->data;\n-\ttx_desc->read.buffer_addr = cpu_to_le64(dma);\n+\ttx_buffer->bytecount = len;\n+\ttx_buffer->gso_segs = 1;\n+\ttx_buffer->protocol = 0;\n+\n+\t/* Populate minimal context descriptor that will provide for the\n+\t * fact that we are expected to process Ethernet frames.\n+\t */\n+\tif (!test_bit(__IXGBEVF_TX_XDP_RING_PRIMED, &ring->state)) {\n+\t\tstruct ixgbe_adv_tx_context_desc *context_desc;\n+\n+\t\tset_bit(__IXGBEVF_TX_XDP_RING_PRIMED, &ring->state);\n+\n+\t\tcontext_desc = IXGBEVF_TX_CTXTDESC(ring, 0);\n+\t\tcontext_desc->vlan_macip_lens\t=\n+\t\t\tcpu_to_le32(ETH_HLEN << IXGBE_ADVTXD_MACLEN_SHIFT);\n+\t\tcontext_desc->seqnum_seed\t= 0;\n+\t\tcontext_desc->type_tucmd_mlhl\t=\n+\t\t\tcpu_to_le32(IXGBE_TXD_CMD_DEXT |\n+\t\t\t\t    IXGBE_ADVTXD_DTYP_CTXT);\n+\t\tcontext_desc->mss_l4len_idx\t= 0;\n+\n+\t\ti = 1;\n+\t}\n \n \t/* put descriptor type bits */\n \tcmd_type = IXGBE_ADVTXD_DTYP_DATA |\n \t\t   IXGBE_ADVTXD_DCMD_DEXT |\n \t\t   IXGBE_ADVTXD_DCMD_IFCS;\n \tcmd_type |= len | IXGBE_TXD_CMD;\n+\n+\ttx_desc = IXGBEVF_TX_DESC(ring, i);\n+\ttx_desc->read.buffer_addr = cpu_to_le64(dma);\n+\n \ttx_desc->read.cmd_type_len = cpu_to_le32(cmd_type);\n \ttx_desc->read.olinfo_status =\n \t\t\tcpu_to_le32((len << IXGBE_ADVTXD_PAYLEN_SHIFT) |\n@@ -1688,6 +1709,7 @@ static void ixgbevf_configure_tx_ring(struct ixgbevf_adapter *adapter,\n \t       sizeof(struct ixgbevf_tx_buffer) * ring->count);\n \n \tclear_bit(__IXGBEVF_HANG_CHECK_ARMED, &ring->state);\n+\tclear_bit(__IXGBEVF_TX_XDP_RING_PRIMED, &ring->state);\n \n \tIXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(reg_idx), txdctl);\n \n",
    "prefixes": [
        "next-queue"
    ]
}