get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 806124,
    "url": "http://patchwork.ozlabs.org/api/patches/806124/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/lede/patch/CAKfDRXjwDqXBMJakmmfSP5+kCE-YimQacYYB8gj2y6br=j-+TQ@mail.gmail.com/",
    "project": {
        "id": 54,
        "url": "http://patchwork.ozlabs.org/api/projects/54/?format=api",
        "name": "LEDE development",
        "link_name": "lede",
        "list_id": "lede-dev.lists.infradead.org",
        "list_email": "lede-dev@lists.infradead.org",
        "web_url": "http://lede-project.org/",
        "scm_url": "",
        "webscm_url": "http://git.lede-project.org/",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<CAKfDRXjwDqXBMJakmmfSP5+kCE-YimQacYYB8gj2y6br=j-+TQ@mail.gmail.com>",
    "list_archive_url": null,
    "date": "2017-08-26T14:47:50",
    "name": "[LEDE-DEV] Transmit timeouts with mtk_eth_soc and MT7621",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": false,
    "hash": "8de2a8fdf814c431f703c59bae220500a4de5eb2",
    "submitter": {
        "id": 34169,
        "url": "http://patchwork.ozlabs.org/api/people/34169/?format=api",
        "name": "Kristian Evensen",
        "email": "kristian.evensen@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/lede/patch/CAKfDRXjwDqXBMJakmmfSP5+kCE-YimQacYYB8gj2y6br=j-+TQ@mail.gmail.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/806124/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/806124/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"J98mCa+w\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"c3oxMjYx\"; dkim-atps=neutral"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xfgrp50dYz9t50\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 27 Aug 2017 00:48:40 +1000 (AEST)",
            "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dlcNm-00060v-Nw; Sat, 26 Aug 2017 14:48:18 +0000",
            "from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dlcNi-0005yi-Qu\n\tfor lede-dev@lists.infradead.org; Sat, 26 Aug 2017 14:48:17 +0000",
            "by mail-wr0-x229.google.com with SMTP id p8so6816554wrf.2\n\tfor <lede-dev@lists.infradead.org>;\n\tSat, 26 Aug 2017 07:47:53 -0700 (PDT)",
            "by 10.223.179.216 with HTTP; Sat, 26 Aug 2017 07:47:50 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209;\n\th=Sender:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:\n\tContent-Type:To:Message-ID:Date:From:References:In-Reply-To:MIME-Version:\n\tReply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date\n\t:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner;\n\tbh=VMA0DEOQMycZF5oZqze/4YKNBTsGhG3gYG5PEgLTEts=;\n\tb=J98mCa+wCW8ebFKTJa6MP9vQh\n\tP0JZZWaRVzsvtyQIEx+Z3WFlB95yHlCM7TOTWllu52Cl7CjeWLlXJOeJvcxqeaOpFy7Uqcg9J2DQk\n\tB4CeADDIOTnA/HSQbJtW2l60Hu2+OD5X1GYBSiTBessBfRgdLQ0tWwd82dfiCVUMsMNBhiUws+Dgd\n\tVJDI79ztBr3fLq4k6VR8ByrzNldkWmTKw8hfscriuUqZnH+cpqCWOCVIaGcH62FpD50FA7egjlvWy\n\tmy2KNXcDr41QfxxfOX7Z4ZvWOXhmHBG91gSL9ks6HGCWTYfyqyxha/+k0MB9hUNFh8Yo1oqf8OL9Z\n\toXigbl2DA==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=BilEnin2LOuzybJAWZHLtm0Bmb+vDjGH+hOxbQjVhjQ=;\n\tb=c3oxMjYxdcloLJrLqo8AhKsbZotbUsi0ilBlh+oMxROOmYRajLGiTF/52UoHnssaw1\n\tU+qYv2n+4pPvTr/ALYh1jryhlcVHu4wWPUOsrS0WLx2FNOgfnh0xw/hspsVPuoZ7nGvn\n\taDc8RnnEtZLlm51fzX3W/64gP1NVjVZQMP4wVLN1BBiTCD1F1dPXIJ4Bqq5lgGKQmW6y\n\t4yu4FLSNsf1E4ZPDJqJQxbokswSWAJB7mMgZp3UL5LyRT7Cx/+k944h7GO7zStneFwNz\n\tSf2tmpEs9b84Z30zNLjKFcQ+SkTTnbKx3pLEXFNY1gjCeqzhEmnD+2XJFiNS+vtRDUyD\n\tCcRw=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=BilEnin2LOuzybJAWZHLtm0Bmb+vDjGH+hOxbQjVhjQ=;\n\tb=DXRu3I0VSrJqldelDapO21XsKqOsRKiRSUak5fPaUrjLaElgLCF40Kc2mKNoKC/LM6\n\t39v/v1r1YrC0LoLUcR3Ecj+lDOTKQHAyFHFmYG0/Uk7gS2iwC9ZHV/HmfoN1DaWtJ3a9\n\t3BYnU9YZ8GQzX+GTcB24PJ2N11X1WBIn2OkbUuudt/gnYB777qQVEmc6aE84nxEAoo+e\n\tQ94RSXRaWW4SnhtwlFy6W9Hg2tJd9vKptwxhCo/5BKbvN8h9zzw8iNGtvkNPLh2FDQVs\n\tlO4CHfER+QqxjyuZNJhwNmpE3stIGm6GiG5JvR3p8kAfe9C9IHwNj72ahjCvzOyqRxvL\n\t8qxw==",
        "X-Gm-Message-State": "AHYfb5jwoHF1q67SB1m0NZPebQoVfAbSRhWsUb+cYyrXnQzyYcz3gW2U\n\tqh4rHoL/5HyhuLmL89h56pUfFUs5eQ==",
        "X-Received": "by 10.223.166.231 with SMTP id t94mr1073136wrc.52.1503758872081; \n\tSat, 26 Aug 2017 07:47:52 -0700 (PDT)",
        "MIME-Version": "1.0",
        "In-Reply-To": "<CAKfDRXjYAWnBUD=csj5FHGNTq3a0BrKjJ+X0KPOK1AhJM4-Fvg@mail.gmail.com>",
        "References": "<CAKfDRXin4uU0uN7WwwJc3-SpuAzSXC0Uae+wERyT2ZQiVyHtgw@mail.gmail.com>\n\t<CAJ0DADJogZ_3-+yUwdprv4kFVhgDk0ai7fK1uxQnu0q88QcrSw@mail.gmail.com>\n\t<CAKfDRXj91cQnHMLO+kmtG3AjQrUaVd-Fm13mh_ZCQuWYpsSB5A@mail.gmail.com>\n\t<CAJ0DADL2O14Rn3yGnmbrD-Wh4_LhyAe40RZhccAWG_HnUw-0yw@mail.gmail.com>\n\t<CAKfDRXifqfEPiTOFHhHVTO+LN=g7R2qZXTc0BzWyrA_f8oVOkg@mail.gmail.com>\n\t<CAJ0DADKeCAxx90EZm+=6mL_SJF5Fyrx6AJicPQVigbXRZpx=gw@mail.gmail.com>\n\t<CAJ0DADJsVCfAveu-CJBq4iBgTuEk4qOe3PDmLDhy0pvnY6WF3A@mail.gmail.com>\n\t<dc544b61-fb37-4816-6c5d-94e59f85bb82@phrozen.org>\n\t<CAKfDRXi4qiKZuq_FZJddgKhNG+wbPn1ySKq+qU7+dBC9ixS7eg@mail.gmail.com>\n\t<30f7c246-74bb-62c1-4045-3c3b6539e732@phrozen.org>\n\t<CAKfDRXif0Dz-GoeDF5veoZ1fOMbCR0cw1i34C0NMk__VdhSaAQ@mail.gmail.com>\n\t<6c0ad875-3b52-107a-df11-3af5f377e95e@phrozen.org>\n\t<CAKfDRXjWSCO-pxOmeAUoF1_a5cu07UFPhrQbgRcwE_vQV6gbgw@mail.gmail.com>\n\t<CAJ0DADJbB8Emss0+ETyan=uTnUc25M0=vc_TR6vGY2GnEDJ-1w@mail.gmail.com>\n\t<CAKfDRXjYAWnBUD=csj5FHGNTq3a0BrKjJ+X0KPOK1AhJM4-Fvg@mail.gmail.com>",
        "From": "Kristian Evensen <kristian.evensen@gmail.com>",
        "Date": "Sat, 26 Aug 2017 16:47:50 +0200",
        "Message-ID": "<CAKfDRXjwDqXBMJakmmfSP5+kCE-YimQacYYB8gj2y6br=j-+TQ@mail.gmail.com>",
        "To": "Mingyu Li <igvtee@gmail.com>",
        "Content-Type": "multipart/mixed; boundary=\"001a114010a4661fff0557a9257d\"",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20170826_074815_180825_2C969292 ",
        "X-CRM114-Status": "GOOD (  24.72  )",
        "X-Spam-Score": "-2.0 (--)",
        "X-Spam-Report": "SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.0 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2a00:1450:400c:c0c:0:0:0:229 listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (kristian.evensen[at]gmail.com)\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain",
        "Subject": "Re: [LEDE-DEV] Transmit timeouts with mtk_eth_soc and MT7621",
        "X-BeenThere": "lede-dev@lists.infradead.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "<lede-dev.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/lede-dev>,\n\t<mailto:lede-dev-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/lede-dev/>",
        "List-Post": "<mailto:lede-dev@lists.infradead.org>",
        "List-Help": "<mailto:lede-dev-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/lede-dev>,\n\t<mailto:lede-dev-request@lists.infradead.org?subject=subscribe>",
        "Cc": "LEDE Development List <lede-dev@lists.infradead.org>,\n\tJohn Crispin <john@phrozen.org>",
        "Sender": "\"Lede-dev\" <lede-dev-bounces@lists.infradead.org>",
        "Errors-To": "lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "Hello again,\n\nOn Sat, Aug 26, 2017 at 12:38 PM, Kristian Evensen\n<kristian.evensen@gmail.com> wrote:\n> Hi,\n>\n> On Sat, Aug 26, 2017 at 7:43 AM, Mingyu Li <igvtee@gmail.com> wrote:\n>> Hi.\n>>\n>> i check the code again. found xmit_more can cause tx timeout. you can\n>> reference this.\n>> https://www.mail-archive.com/netdev@vger.kernel.org/msg123334.html\n>> so the patch should be like this. edit mtk_eth_soc.c\n>>\n>>         tx_num = fe_cal_txd_req(skb);\n>>         if (unlikely(fe_empty_txd(ring) <= tx_num)) {\n>> +                if (skb->xmit_more)\n>> +                        fe_reg_w32(ring->tx_next_idx, FE_REG_TX_CTX_IDX0);\n>>                 netif_stop_queue(dev);\n>>                 netif_err(priv, tx_queued, dev,\n>>                           \"Tx Ring full when queue awake!\\n\");\n>>\n>> but i am not sure. maybe the pause frame cause the problem.\n>\n> Thanks for the patch. I tested it, but I unfortunately still see the\n> error. I also added a print-statement inside the conditional and can\n> see that the condition is never hit. I also don't see the \"Tx Ring\n> full\"-message. One difference which I noticed now though, is that I\n> don't see the bursty bandwidth pattern I described earlier (32, 0, 32,\n> 0, ...). With your patch, it is always 32, 0, crash.\n\nI spent some more time looking into this today and think I might have\nbeen able to solve the issue. My test has been running for ~2 hours\nnow without any errors (before it would best-case work for 10-15\nminutes), and I do not see any performance regressions. Before going\ninto detail, I should probably point out that I am not very familiar\nwith driver development, so my observation changes might not be\nappropriate/correct :)\n\nI guess our common theory is that something is causing TX interrupts\nnot to be enabled again. After reading up on NAPI\n(https://wiki.linuxfoundation.org/networking/napi), it seems that the\nrecommended way of using NAPI on clear-on-write devices (like the\nRT5350) is to use NAPI for RX and do TX in the interrupt handler. In\nthe current driver, both TX and RX is handled in the NAPI-callback\nfe_poll(). I have modified the driver to split RX and TX, so now\nfe_poll() only deals with RX and TX is dealt with in fe_handle_irq().\nI have attached the (messy) patch I am currently testing. If this is\nan OK solution, I will clean up the patch and submit is to the list. I\nwill leave my tests running overnight and report back if anything pops\nup.\n\nI guess that Johns new driver is the future for mtk_sock_eth, but I\nbelieve that fixing this issue for the current driver is worthwhile.\nAs things are now, is it possible to DDOS RT5350-based routers running\nLEDE 17.01 by just sending the correct type of traffic.\n\n-Kristian",
    "diff": "From 98ce0313cd8654fe69028c19b6f08da1d0671d75 Mon Sep 17 00:00:00 2001\nFrom: Kristian Evensen <kristian.evensen@gmail.com>\nDate: Sat, 26 Aug 2017 16:05:44 +0200\nSubject: [PATCH] [FIX] Move TX out of Napi\n\nThis is a broken patch only meant for backup.\n---\n .../drivers/net/ethernet/mtk/mtk_eth_soc.c         | 36 +++++++++++++++++-----\n 1 file changed, 28 insertions(+), 8 deletions(-)\n\ndiff --git a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c\nindex 5b354a6563..af865826e8 100644\n--- a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c\n+++ b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c\n@@ -684,10 +684,13 @@ static int fe_tx_map_dma(struct sk_buff *skb, struct net_device *dev,\n \t */\n \twmb();\n \tif (unlikely(fe_empty_txd(ring) <= ring->tx_thresh)) {\n+        pr_info_ratelimited(\"netif_stop_queue %u %u\\n\", fe_empty_txd(ring), ring->tx_thresh);\n \t\tnetif_stop_queue(dev);\n \t\tsmp_mb();\n-\t\tif (unlikely(fe_empty_txd(ring) > ring->tx_thresh))\n+\t\tif (unlikely(fe_empty_txd(ring) > ring->tx_thresh)) {\n+            pr_info_ratelimited(\"netif_wake_queue\\n\");\n \t\t\tnetif_wake_queue(dev);\n+        }\n \t}\n \n \tif (netif_xmit_stopped(netdev_get_tx_queue(dev, 0)) || !skb->xmit_more)\n@@ -781,6 +784,10 @@ static int fe_start_xmit(struct sk_buff *skb, struct net_device *dev)\n \n \ttx_num = fe_cal_txd_req(skb);\n \tif (unlikely(fe_empty_txd(ring) <= tx_num)) {\n+        if (skb->xmit_more) {\n+            pr_info_ratelimited(\"SKB XMIT_MORE\\n\");\n+            fe_reg_w32(ring->tx_next_idx, FE_REG_TX_CTX_IDX0);\n+        }\n \t\tnetif_stop_queue(dev);\n \t\tnetif_err(priv, tx_queued, dev,\n \t\t\t  \"Tx Ring full when queue awake!\\n\");\n@@ -967,11 +974,12 @@ static int fe_poll(struct napi_struct *napi, int budget)\n \t\tstatus_reg = FE_REG_FE_INT_STATUS;\n \t}\n \n+    /*\n    if (status & tx_intr) {\n            fe_reg_w32(tx_intr, FE_REG_FE_INT_STATUS);\n            tx_done = fe_poll_tx(priv);\n            status = fe_reg_r32(FE_REG_FE_INT_STATUS);\n-   }\n+   }*/\n \n \tif (status & rx_intr)\n \t\trx_done = fe_poll_rx(napi, budget, priv, rx_intr);\n@@ -1042,18 +1050,30 @@ static irqreturn_t fe_handle_irq(int irq, void *dev)\n {\n \tstruct fe_priv *priv = netdev_priv(dev);\n \tu32 status, int_mask;\n+    u32 tx_intr, rx_intr;\n+\n+\ttx_intr = priv->soc->tx_int;\n+\trx_intr = priv->soc->rx_int;\n \n \tstatus = fe_reg_r32(FE_REG_FE_INT_STATUS);\n \n \tif (unlikely(!status))\n \t\treturn IRQ_NONE;\n \n-\tint_mask = (priv->soc->rx_int | priv->soc->tx_int);\n+\tint_mask = tx_intr | rx_intr;\n \tif (likely(status & int_mask)) {\n-\t\tif (likely(napi_schedule_prep(&priv->rx_napi))) {\n-\t\t\tfe_int_disable(int_mask);\n-\t\t\t__napi_schedule(&priv->rx_napi);\n-\t\t}\n+        if (status & rx_intr) {\n+    \t\tif (likely(napi_schedule_prep(&priv->rx_napi))) {\n+\t    \t\tfe_int_disable(rx_intr);\n+\t\t    \t__napi_schedule(&priv->rx_napi);\n+\t\t    }\n+        }\n+\n+        if (status & tx_intr) {\n+            fe_reg_w32(tx_intr, FE_REG_FE_INT_STATUS);\n+            fe_poll_tx(priv);\n+\t\t    fe_int_enable(tx_intr);\n+        }\n \t} else {\n \t\tfe_reg_w32(status, FE_REG_FE_INT_STATUS);\n \t}\n@@ -1549,7 +1569,7 @@ static int fe_probe(struct platform_device *pdev)\n \n \tplatform_set_drvdata(pdev, netdev);\n \n-\tnetif_info(priv, probe, netdev, \"mediatek frame engine at 0x%08lx, irq %d\\n\",\n+\tnetif_info(priv, probe, netdev, \"mediatek frame engine at 0x%08lx, irq %d - patched\\n\",\n \t\t   netdev->base_addr, netdev->irq);\n \n \treturn 0;\n-- \n2.11.0\n\n",
    "prefixes": [
        "LEDE-DEV"
    ]
}