get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 488561,
    "url": "http://patchwork.ozlabs.org/api/patches/488561/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1435268623-17648-1-git-send-email-jacob.e.keller@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": "<1435268623-17648-1-git-send-email-jacob.e.keller@intel.com>",
    "list_archive_url": null,
    "date": "2015-06-25T21:43:43",
    "name": "[v3] fm10k: drop transmitted messages in Tx FIFO as part of reset_work",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "807ad06adc3a80029c83a687bd9f5dbbb8c29f53",
    "submitter": {
        "id": 9784,
        "url": "http://patchwork.ozlabs.org/api/people/9784/?format=api",
        "name": "Jacob Keller",
        "email": "jacob.e.keller@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/1435268623-17648-1-git-send-email-jacob.e.keller@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/488561/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/488561/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.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"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ozlabs.org (Postfix) with ESMTP id 27FC0140273\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 26 Jun 2015 07:43:53 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 6AA7995E59;\n\tThu, 25 Jun 2015 21:43:52 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id cC4O1Tth0xah; Thu, 25 Jun 2015 21:43:51 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id D24EE95E50;\n\tThu, 25 Jun 2015 21:43:51 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id BCA4F1C25D9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 25 Jun 2015 21:43:50 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id B2D0EA4074\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 25 Jun 2015 21:43:50 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id Rb7oQ7O8kHuY for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 25 Jun 2015 21:43:49 +0000 (UTC)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 9A15AA4068\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 25 Jun 2015 21:43:49 +0000 (UTC)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga103.fm.intel.com with ESMTP; 25 Jun 2015 14:43:49 -0700",
            "from jekeller-desk.amr.corp.intel.com ([134.134.3.85])\n\tby fmsmga002.fm.intel.com with ESMTP; 25 Jun 2015 14:43:50 -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-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.13,680,1427785200\"; d=\"scan'208\";a=\"750568037\"",
        "From": "Jacob Keller <jacob.e.keller@intel.com>",
        "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>",
        "Date": "Thu, 25 Jun 2015 14:43:43 -0700",
        "Message-Id": "<1435268623-17648-1-git-send-email-jacob.e.keller@intel.com>",
        "X-Mailer": "git-send-email 2.4.3",
        "Subject": "[Intel-wired-lan] [PATCH v3] fm10k: drop transmitted messages in Tx\n\tFIFO as part of reset_work",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "This patch fixes a corner case issue with the PF/VF mailbox code.\nCurrently, fm10k_mbx_reset_work clears various state about the mailbox.\nHowever, it does not clear the Tx FIFO head/tail pointers. We can't\nsimply clear these pointers as we unintentionally drop untransmitted\nmessages without error.\n\nDoing nothing results in a possible phantom re-transmission of messages,\nsince we leave tx.head and tx.tail intact, but clear the tx_pulled and\ntail_len values. This means that the PF could continuously re-send a\nmessage which triggers a reset in the VF. Upon reset, the VF will\nre-receive the same message after a reconnect.\n\nIf we reset the tx.head and tx.tail pointers completely, we end up\ndropping some messages that were pending before connect. This results in\nmissing LPORT_MSG_READY bits, and VFs will end up reporting no link.\n\nHowever, we can resolve both issues by simply incrementing head to\naccount for the already transmitted messages, before we reset tx_pulled.\nWe do this via the same logic as fm10k_mbx_head_pull.\n\nWe account for the tail_len which includes all data not yet transmitted,\nonce we account for the acked data which means re-reading the HEAD\nvariable from the message header. Then, we drop messages until we've\ndropped more than the new tx_pulled value. At this point, resetting\ntail_len and tx_pulled, but not tx.head and tx.tail will result in\nprevention of the phantom message. It also prevents us from dropping\nuntransmitted messages upon attempting to Tx into a connect or\ndisconnect header.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/fm10k/fm10k_mbx.c | 19 ++++++++++++++++++-\n 1 file changed, 18 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c\nindex 1a4b52637de9..0ff21d1fb9db 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c\n@@ -1046,9 +1046,26 @@ static s32 fm10k_mbx_create_reply(struct fm10k_hw *hw,\n  **/\n static void fm10k_mbx_reset_work(struct fm10k_mbx_info *mbx)\n {\n+\tu16 len, head, ack;\n+\n \t/* reset our outgoing max size back to Rx limits */\n \tmbx->max_size = mbx->rx.size - 1;\n \n+\t/* update mbx->pulled to account for tail_len and ack */\n+\thead = FM10K_MSG_HDR_FIELD_GET(mbx->mbx_hdr, HEAD);\n+\tack = fm10k_mbx_index_len(mbx, head, mbx->tail);\n+\tmbx->pulled += mbx->tail_len - ack;\n+\n+\t/* now drop any messages which have started or finished transmitting */\n+\twhile (fm10k_fifo_head_len(&mbx->tx) && mbx->pulled) {\n+\t\tlen = fm10k_fifo_head_drop(&mbx->tx);\n+\t\tmbx->tx_dropped++;\n+\t\tif (mbx->pulled >= len)\n+\t\t\tmbx->pulled -= len;\n+\t\telse\n+\t\t\tmbx->pulled = 0;\n+\t}\n+\n \t/* just do a quick resysnc to start of message */\n \tmbx->pushed = 0;\n \tmbx->pulled = 0;\n@@ -1725,7 +1742,7 @@ static void fm10k_sm_mbx_disconnect(struct fm10k_hw *hw,\n \tmbx->state = FM10K_STATE_CLOSED;\n \tmbx->remote = 0;\n \tfm10k_mbx_reset_work(mbx);\n-\tfm10k_mbx_update_max_size(mbx, 0);\n+\tfm10k_fifo_drop_all(&mbx->tx);\n \n \tfm10k_write_reg(hw, mbx->mbmem_reg, 0);\n }\n",
    "prefixes": [
        "v3"
    ]
}