get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 9630,
    "url": "https://patches.dpdk.org/api/patches/9630/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1450813790-11874-3-git-send-email-lsun@ezchip.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": "<1450813790-11874-3-git-send-email-lsun@ezchip.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1450813790-11874-3-git-send-email-lsun@ezchip.com",
    "date": "2015-12-22T19:49:50",
    "name": "[dpdk-dev,2/2] driver/net/mpipe: fix the crash/hung issue when testpmd quits",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f8dde8d4ae3f18c40f074943259c79d6bfebbce3",
    "submitter": {
        "id": 399,
        "url": "https://patches.dpdk.org/api/people/399/?format=api",
        "name": "Liming Sun",
        "email": "lsun@ezchip.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1450813790-11874-3-git-send-email-lsun@ezchip.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/9630/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/9630/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 1773B8DB2;\n\tTue, 22 Dec 2015 20:50:38 +0100 (CET)",
            "from EUR01-VE1-obe.outbound.protection.outlook.com\n\t(mail-ve1eur01on0041.outbound.protection.outlook.com [104.47.1.41])\n\tby dpdk.org (Postfix) with ESMTP id A48378DB2\n\tfor <dev@dpdk.org>; Tue, 22 Dec 2015 20:50:36 +0100 (CET)",
            "from AM4PR02CA0039.eurprd02.prod.outlook.com (10.165.239.177) by\n\tHE1PR02MB1017.eurprd02.prod.outlook.com (10.163.172.147) with\n\tMicrosoft SMTP\n\tServer (TLS) id 15.1.361.13; Tue, 22 Dec 2015 19:50:34 +0000",
            "from DB3FFO11FD037.protection.gbl (2a01:111:f400:7e04::170) by\n\tAM4PR02CA0039.outlook.office365.com (2a01:111:e400:7a66::49) with\n\tMicrosoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport;\n\tTue, 22 Dec 2015 19:50:34 +0000",
            "from lab-43.internal.tilera.com (12.216.194.146) by\n\tDB3FFO11FD037.mail.protection.outlook.com (10.47.217.68) with\n\tMicrosoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport;\n\tTue, 22 Dec 2015 19:50:33 +0000",
            "(from lsun@localhost)\n\tby lab-43.internal.tilera.com (8.14.4/8.14.4/Submit) id\n\ttBMJoW1t012022; Tue, 22 Dec 2015 14:50:32 -0500"
        ],
        "Authentication-Results": "spf=fail (sender IP is 12.216.194.146)\n\tsmtp.mailfrom=ezchip.com; ezchip.com; dkim=none (message not signed)\n\theader.d=none; ezchip.com;\n\tdmarc=none action=none header.from=ezchip.com; ",
        "Received-SPF": "Fail (protection.outlook.com: domain of ezchip.com does not\n\tdesignate 12.216.194.146 as permitted sender)\n\treceiver=protection.outlook.com; client-ip=12.216.194.146;\n\thelo=lab-43.internal.tilera.com;",
        "From": "Liming Sun <lsun@ezchip.com>",
        "To": "<dev@dpdk.org>",
        "Date": "Tue, 22 Dec 2015 14:49:50 -0500",
        "Message-ID": "<1450813790-11874-3-git-send-email-lsun@ezchip.com>",
        "X-Mailer": "git-send-email 1.7.1",
        "In-Reply-To": "<1450813790-11874-1-git-send-email-lsun@ezchip.com>",
        "References": "<1450813790-11874-1-git-send-email-lsun@ezchip.com>",
        "X-EOPAttributedMessage": "0",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; DB3FFO11FD037;\n\t1:S1Bg61HUgPnEh6+f98vkBSaTioeb3R3v4+7/TmqdnQfmlEzvNloWUroljeJUnueSauvdA/je0mveoShA2HaAiqzFbVGRCikDGNDv6cRSfwamgP9B9kJKWUzdDYRvZjFzPtG12gMSjUYRH9E2aeg070nolB8DWyciJ3W0FYldR0NWyh2WenXT3w0V10V8dwdMCJ9JIcDKnTjM2EVZRvBLf2M+HYmcRtSVZJHzw2SusBJj9rdo3xdOF8ljdFHCwCVnFxbbQHLuiXStmrGIAhW05EggsDXAh+SaF57Fa4ioPEX7X4GPfFZibh7kGmNczjK49Qr/qs9DwBXv4laOBk1ftCU73KNfBWeUJfCBaO9JE5gjq7rcxSdgcpGnYrvpp6NbtEaCqmR1Y2FKDShDyaLxow==",
            "1; HE1PR02MB1017;\n\t2:+gA5FaruassNtKBCdl6qYRu5Mnf+F0DgvCqt1MDwWpFotkd2tMCWukvLGQRVQfUFad84eS8MC3N3L+3mNlpKH+UTUsMoESs+63RWlL5kczxCyqOB70RyDXN+H6r2B5YB49jDcV7MEgaDoGZ7ystRgQ==;\n\t3:AIdReUGE6kW7EFAxiwVLUs7Ckn+Q6fWzNae4OrxCBotoOVopmB4eYCwfu1bRPOOh70nQHuF6giuXcELwE0nOsulzFF0A94GxJBGPjmti3Rn92fZaxdrorGW0Iv2DLq4fWt+Aks6Z0JCQcz4YhjjJ2vO56ttmEIA9S6KTnMCoPTF+OGgdVZnMkt81rnPQ2Mlshp65iTfGELjkeM+ls8GUYXh5hqGZE8DwY6qyBaByN8E=;\n\t25:Z0BVc3i3wBDbG4Lt4mMjLizJzQ/gWI03doJSiK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rJVFyZ8Q1eEPq0igx9kx3r3H?=\n\t=?us-ascii?Q?9EOIGJ5KbRMnsqv+u6mHEb+FzQkqlYEAH+m60ZZhHM8JxKP+aOdIc+jvQ48p?=\n\t=?us-ascii?Q?QQd47Z35151sDtHRiRT94PPwVbKX+fspwnvtPrRgk5tm8Isvg=3D=3D?=",
            "1; HE1PR02MB1017;\n\t5:/fFXICVdjp9yQEb5lcRTLDpZ46vWp17mFCq3gSHAxH1LGsB97100qUWeqv6ds5a2XgSxwxqAFZ5+HpUDabSuu4zVYogONeRWL/0d8kafc82QBMDrcyOAgMr9xgV8w5av0yfx+hkQAZetDlohJT93Bg==;\n\t24:J7sPm2uR6tsqbODIo3i18lZRRwIhxsqED2BAFYOdPtyWTONFk+kPQUbfKkpAg9Nlh3H3WHdn91OX1GWZqJQ2lJmLmdJ2wFRc1K3Z8eXo7NE="
        ],
        "X-Forefront-Antispam-Report": "CIP:12.216.194.146; CTRY:US; IPV:NLI; EFV:NLI; \n\tSFV:NSPM;\n\tSFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(42186005)(4001430100002)(76176999)(11100500001)(50986999)(47776003)(5003940100001)(106466001)(229853001)(110136002)(107886002)(5001970100001)(19580405001)(87936001)(104016004)(33646002)(85426001)(450100001)(1096002)(1220700001)(2351001)(586003)(50466002)(6806005)(86362001)(92566002)(105606002)(50226001)(2950100001)(36756003)(48376002)(19580395003)(189998001)(5008740100001);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR02MB1017;\n\tH:lab-43.internal.tilera.com; \n\tFPR:; SPF:Fail; PTR:wb-fw1.tilera.com; A:1; MX:1; LANG:en; ",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Microsoft-Antispam": "UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR02MB1017;",
        "X-Microsoft-Antispam-PRVS": "<HE1PR02MB1017704D57CBEFAED77D5A34BCE50@HE1PR02MB1017.eurprd02.prod.outlook.com>",
        "X-Exchange-Antispam-Report-Test": "UriScan:(121898900299872);",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046);\n\tSRVR:HE1PR02MB1017; BCL:0; PCL:0; RULEID:; SRVR:HE1PR02MB1017; ",
        "X-Forefront-PRVS": "0798146F16",
        "SpamDiagnosticOutput": "1:23",
        "SpamDiagnosticMetadata": "NSPM",
        "X-OriginatorOrg": "ezchip.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "22 Dec 2015 19:50:33.9683\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-Id": "0fc16e0a-3cd3-4092-8b2f-0a42cff122c3",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3;\n\tIp=[12.216.194.146]; \n\tHelo=[lab-43.internal.tilera.com]",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "HE1PR02MB1017",
        "Subject": "[dpdk-dev] [PATCH 2/2] driver/net/mpipe: fix the crash/hung issue\n\twhen testpmd quits",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "1. Fixed the compiling issue of the ethtool example on tilegx\n   platform.\n2. Fixed the hung/crash issue when quitting testpmd under high\n   traffic rate. The buffer error bit needs to be checked before\n   processing the idesc and releasing the buffer. Code logic is\n   also simplified.\n\nSigned-off-by: Liming Sun <lsun@ezchip.com>\n---\n drivers/net/mpipe/mpipe_tilegx.c                   |   46 +++++++-------------\n .../common/include/arch/tile/rte_rwlock.h          |    1 +\n 2 files changed, 17 insertions(+), 30 deletions(-)",
    "diff": "diff --git a/drivers/net/mpipe/mpipe_tilegx.c b/drivers/net/mpipe/mpipe_tilegx.c\nindex 8d006fa..4cb54c3 100644\n--- a/drivers/net/mpipe/mpipe_tilegx.c\n+++ b/drivers/net/mpipe/mpipe_tilegx.c\n@@ -134,7 +134,6 @@ struct mpipe_dev_priv {\n \tstruct rte_mempool *rx_mpool;\t/* mpool used by the rx queues. */\n \tunsigned rx_offset;\t\t/* Receive head room. */\n \tunsigned rx_size_code;\t\t/* mPIPE rx buffer size code. */\n-\tunsigned rx_buffers;\t\t/* receive buffers on stack. */\n \tint is_xaui:1,\t\t\t/* Is this an xgbe or gbe? */\n \t    initialized:1,\t\t/* Initialized port? */\n \t    running:1;\t\t\t/* Running port? */\n@@ -529,7 +528,6 @@ mpipe_recv_fill_stack(struct mpipe_dev_priv *priv, int count)\n \t\tmpipe_recv_push(priv, mbuf);\n \t}\n \n-\tpriv->rx_buffers += count;\n \tPMD_DEBUG_RX(\"%s: Filled %d/%d buffers\\n\", mpipe_name(priv), i, count);\n }\n \n@@ -539,10 +537,9 @@ mpipe_recv_flush_stack(struct mpipe_dev_priv *priv)\n \tconst int offset = priv->rx_offset & ~RTE_MEMPOOL_ALIGN_MASK;\n \tuint8_t in_port = priv->port_id;\n \tstruct rte_mbuf *mbuf;\n-\tunsigned count;\n \tvoid *va;\n \n-\tfor (count = 0; count < priv->rx_buffers; count++) {\n+\twhile (1) {\n \t\tva = gxio_mpipe_pop_buffer(priv->context, priv->stack);\n \t\tif (!va)\n \t\t\tbreak;\n@@ -561,10 +558,6 @@ mpipe_recv_flush_stack(struct mpipe_dev_priv *priv)\n \n \t\t__rte_mbuf_raw_free(mbuf);\n \t}\n-\n-\tPMD_DEBUG_RX(\"%s: Returned %d/%d buffers\\n\",\n-\t\t     mpipe_name(priv), count, priv->rx_buffers);\n-\tpriv->rx_buffers -= count;\n }\n \n static void\n@@ -1246,31 +1239,23 @@ mpipe_recv_flush(struct mpipe_dev_priv *priv)\n \tgxio_mpipe_iqueue_t *iqueue;\n \tgxio_mpipe_idesc_t idesc;\n \tstruct rte_mbuf *mbuf;\n-\tint retries = 0;\n \tunsigned queue;\n \n-\tdo {\n-\t\tmpipe_recv_flush_stack(priv);\n-\n-\t\t/* Flush packets sitting in recv queues. */\n-\t\tfor (queue = 0; queue < priv->nb_rx_queues; queue++) {\n-\t\t\trx_queue = mpipe_rx_queue(priv, queue);\n-\t\t\tiqueue = &rx_queue->iqueue;\n-\t\t\twhile (gxio_mpipe_iqueue_try_get(iqueue, &idesc) >= 0) {\n-\t\t\t\tmbuf = mpipe_recv_mbuf(priv, &idesc, in_port);\n-\t\t\t\trte_pktmbuf_free(mbuf);\n-\t\t\t\tpriv->rx_buffers--;\n-\t\t\t}\n-\t\t\trte_free(rx_queue->rx_ring_mem);\n-\t\t}\n-\t} while (retries++ < 10 && priv->rx_buffers);\n+\t/* Release packets on the buffer stack. */\n+\tmpipe_recv_flush_stack(priv);\n \n-\tif (priv->rx_buffers) {\n-\t\tRTE_LOG(ERR, PMD, \"%s: Leaked %d receive buffers.\\n\",\n-\t\t\tmpipe_name(priv), priv->rx_buffers);\n-\t} else {\n-\t\tPMD_DEBUG_RX(\"%s: Returned all receive buffers.\\n\",\n-\t\t\t     mpipe_name(priv));\n+\t/* Flush packets sitting in recv queues. */\n+\tfor (queue = 0; queue < priv->nb_rx_queues; queue++) {\n+\t\trx_queue = mpipe_rx_queue(priv, queue);\n+\t\tiqueue = &rx_queue->iqueue;\n+\t\twhile (gxio_mpipe_iqueue_try_get(iqueue, &idesc) >= 0) {\n+\t\t\t/* Skip idesc with the 'buffer error' bit set. */\n+\t\t\tif (idesc.be)\n+\t\t\t\tcontinue;\n+\t\t\tmbuf = mpipe_recv_mbuf(priv, &idesc, in_port);\n+\t\t\trte_pktmbuf_free(mbuf);\n+\t\t}\n+\t\trte_free(rx_queue->rx_ring_mem);\n \t}\n }\n \n@@ -1339,6 +1324,7 @@ mpipe_do_xmit(struct mpipe_tx_queue *tx_queue, struct rte_mbuf **tx_pkts,\n \t\t\t\t.xfer_size = rte_pktmbuf_data_len(mbuf),\n \t\t\t\t.bound     = next ? 0 : 1,\n \t\t\t\t.stack_idx = mpipe_mbuf_stack_index(priv, mbuf),\n+\t\t\t\t.size      = priv->rx_size_code,\n \t\t\t} };\n \t\t\tif (mpipe_local.mbuf_push_debt[port_id] > 0) {\n \t\t\t\tmpipe_local.mbuf_push_debt[port_id]--;\ndiff --git a/lib/librte_eal/common/include/arch/tile/rte_rwlock.h b/lib/librte_eal/common/include/arch/tile/rte_rwlock.h\nindex 8f67a19..6d609e8 100644\n--- a/lib/librte_eal/common/include/arch/tile/rte_rwlock.h\n+++ b/lib/librte_eal/common/include/arch/tile/rte_rwlock.h\n@@ -38,6 +38,7 @@ extern \"C\" {\n #endif\n \n #include \"generic/rte_rwlock.h\"\n+#include <rte_spinlock.h>\n \n static inline void\n rte_rwlock_read_lock_tm(rte_rwlock_t *rwl)\n",
    "prefixes": [
        "dpdk-dev",
        "2/2"
    ]
}