get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 49573,
    "url": "https://patches.dpdk.org/api/patches/49573/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190110102235.1238-3-hyonkim@cisco.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": "<20190110102235.1238-3-hyonkim@cisco.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190110102235.1238-3-hyonkim@cisco.com",
    "date": "2019-01-10T10:22:35",
    "name": "[2/2] net/bonding: avoid the next active slave going out of bound",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "70b15d7935683d2002689caa76d1a2ff50ac1399",
    "submitter": {
        "id": 948,
        "url": "https://patches.dpdk.org/api/people/948/?format=api",
        "name": "Hyong Youb Kim (hyonkim)",
        "email": "hyonkim@cisco.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190110102235.1238-3-hyonkim@cisco.com/mbox/",
    "series": [
        {
            "id": 3083,
            "url": "https://patches.dpdk.org/api/series/3083/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=3083",
            "date": "2019-01-10T10:22:33",
            "name": "net/bonding: a couple minor fixes",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/3083/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/49573/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/49573/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 55D561B5FD;\n\tThu, 10 Jan 2019 11:23:41 +0100 (CET)",
            "from rcdn-iport-8.cisco.com (rcdn-iport-8.cisco.com [173.37.86.79])\n\tby dpdk.org (Postfix) with ESMTP id 391931B5F5;\n\tThu, 10 Jan 2019 11:23:38 +0100 (CET)",
            "from alln-core-1.cisco.com ([173.36.13.131])\n\tby rcdn-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t10 Jan 2019 10:23:37 +0000",
            "from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48])\n\tby alln-core-1.cisco.com (8.15.2/8.15.2) with ESMTP id x0AANbZJ008703;\n\tThu, 10 Jan 2019 10:23:37 GMT",
            "by cisco.com (Postfix, from userid 508933)\n\tid 09DF120F2001; Thu, 10 Jan 2019 02:23:37 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=cisco.com; i=@cisco.com; l=2637; q=dns/txt; s=iport;\n\tt=1547115818; x=1548325418;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=GNUDkAsuoLMRVgwhkU5k0/ftG87D1HZJ74rUYqC3VnA=;\n\tb=iHjLyg0LqCd2AyhKop3ZZeN5SuX6vawtG0qxTuVa8B0O1dLdezTHP9en\n\tIRHPpQD2noQUrI/O9fYrjBGMDz/76kByaizqhI6exgK8EREgXhvoF/GmP\n\tEoZuHb4jrmFzFtvZT8DmVbLX1MPFrexYNmJ9GeRYUxQAniGOmOU7HF1P4 U=;",
        "X-IronPort-AV": "E=Sophos;i=\"5.56,460,1539648000\"; d=\"scan'208\";a=\"502009397\"",
        "From": "Hyong Youb Kim <hyonkim@cisco.com>",
        "To": "Ferruh Yigit <ferruh.yigit@intel.com>,\n\tDeclan Doherty <declan.doherty@intel.com>, Chas Williams <chas3@att.com>",
        "Cc": "dev@dpdk.org, Hyong Youb Kim <hyonkim@cisco.com>, stable@dpdk.org",
        "Date": "Thu, 10 Jan 2019 02:22:35 -0800",
        "Message-Id": "<20190110102235.1238-3-hyonkim@cisco.com>",
        "X-Mailer": "git-send-email 2.16.2",
        "In-Reply-To": "<20190110102235.1238-1-hyonkim@cisco.com>",
        "References": "<20190110102235.1238-1-hyonkim@cisco.com>",
        "X-Outbound-SMTP-Client": "10.193.184.48, savbu-usnic-a.cisco.com",
        "X-Outbound-Node": "alln-core-1.cisco.com",
        "Subject": "[dpdk-dev] [PATCH 2/2] net/bonding: avoid the next active slave\n\tgoing out of bound",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "For bonding modes like broadcast that use bond_ethdev_rx_burst(), it\nis fairly easy to produce a crash simply by bringing a slave port's\nlink down. When slave links go down, the driver on one thread reduces\nactive_slave_count via the LSC callback and deactivate_slave(). At the\nsame time, bond_ethdev_rx_burst() running on a forwarding thread may\nincrement active_slave (next active slave) beyond\nactive_slave_count. Here is a typical sequence of events.\n\nAt time 0:\nactive_slave_count = 3\nactive_slave = 2\n\nAt time 1:\nA slave link goes down.\nThread 0 (main) reduces active_slave_count to 2.\n\nAt time 2:\nThread 1 (forwarding) executes bond_ethdev_rx_burst().\n- Reads active_slave_count = 2.\n- Increments active_slave at the end to 3.\n\nFrom this point on, everytime bond_ethdev_rx_burst() runs,\nactive_slave increments by one, eventually going well out of bound of\nthe active_slaves array and causing a crash.\n\nMake the rx burst function to first check that active_slave is within\nbound. If not, reset it to 0 to avoid out-of-range array access.\n\nFixes: e1110e977648 (\"net/bonding: fix Rx slave fairness\")\nCc: stable@dpdk.org\n\nSigned-off-by: Hyong Youb Kim <hyonkim@cisco.com>\n---\n drivers/net/bonding/rte_eth_bond_pmd.c | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)",
    "diff": "diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c\nindex daf2440cd..bc2405e54 100644\n--- a/drivers/net/bonding/rte_eth_bond_pmd.c\n+++ b/drivers/net/bonding/rte_eth_bond_pmd.c\n@@ -68,6 +68,15 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)\n \tinternals = bd_rx_q->dev_private;\n \tslave_count = internals->active_slave_count;\n \tactive_slave = internals->active_slave;\n+\t/*\n+\t * Reset the active slave index, in case active_slave goes out\n+\t * of bound.  It can hapen when slave links go down, and\n+\t * another thread (LSC callback) shrinks the slave count.\n+\t */\n+\tif (active_slave >= slave_count) {\n+\t\tinternals->active_slave = 0;\n+\t\tactive_slave = 0;\n+\t}\n \n \tfor (i = 0; i < slave_count && nb_pkts; i++) {\n \t\tuint16_t num_rx_slave;\n@@ -273,6 +282,11 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs,\n \tactive_slave = internals->active_slave;\n \tmemcpy(slaves, internals->active_slaves,\n \t\t\tsizeof(internals->active_slaves[0]) * slave_count);\n+\t/* active_slave may go out of bound. See bond_ethdev_rx_burst() */\n+\tif (active_slave >= slave_count) {\n+\t\tinternals->active_slave = 0;\n+\t\tactive_slave = 0;\n+\t}\n \n \tfor (i = 0; i < slave_count && nb_pkts; i++) {\n \t\tuint16_t num_rx_slave;\n",
    "prefixes": [
        "2/2"
    ]
}