get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 506,
    "url": "https://patches.dpdk.org/api/patches/506/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1411637801-90846-1-git-send-email-balazs.nemeth@intel.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": "<1411637801-90846-1-git-send-email-balazs.nemeth@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1411637801-90846-1-git-send-email-balazs.nemeth@intel.com",
    "date": "2014-09-25T09:36:41",
    "name": "[dpdk-dev] lib/librte_pmd_ixgbe: Fix crash caused by bulk allocation failure",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "03a57a5ca667ae23ec95585676b37e84480ea199",
    "submitter": {
        "id": 67,
        "url": "https://patches.dpdk.org/api/people/67/?format=api",
        "name": "Balazs Nemeth",
        "email": "balazs.nemeth@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1411637801-90846-1-git-send-email-balazs.nemeth@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/506/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/506/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 EA8BFB3E8;\n\tThu, 25 Sep 2014 11:29:25 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 4CA19B3DA\n\tfor <dev@dpdk.org>; Thu, 25 Sep 2014 11:29:24 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga102.fm.intel.com with ESMTP; 25 Sep 2014 02:35:40 -0700",
            "from bnemeth-mobl.ger.corp.intel.com (HELO bn-ivy12.localdomain)\n\t([172.22.195.65])\n\tby fmsmga002.fm.intel.com with ESMTP; 25 Sep 2014 02:35:38 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,595,1406617200\"; d=\"scan'208\";a=\"605144942\"",
        "From": "Balazs Nemeth <balazs.nemeth@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 25 Sep 2014 09:36:41 +0000",
        "Message-Id": "<1411637801-90846-1-git-send-email-balazs.nemeth@intel.com>",
        "X-Mailer": "git-send-email 2.1.0",
        "Cc": "Balazs Nemeth <balazs.nemeth@intel.com>",
        "Subject": "[dpdk-dev] [PATCH] lib/librte_pmd_ixgbe: Fix crash caused by bulk\n\tallocation failure",
        "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": "Since the introduction of vector PMD, a bug in ixgbe_rxq_rearm could\ncause a crash. As long as the memory pool allocated to the RX queue\nhas mbufs available, there is no problem. After allocation of _all_\nmbufs from the memory pool, previously returned mbufs by\nrte_eth_rx_burst could be accessed by subsequent calls to the PMD and\ncould be returned by subsequent calls to rte_eth_rx_burst. From the\nperspective of the application, the means that fields within the mbuf\ncould change and that previously allocated mbufs could appear multiple\ntimes.\n\nAfter failure of mbuf allocation, the dd bits should indicate that the\npackets are not ready. For this, this patch adds code to reset the dd\nbits in the first RTE_IXGBE_DESCS_PER_LOOP packets of the next\nRTE_IXGBE_RXQ_REARM_THRESH packets only if the next\nRTE_IXGBE_RXQ_REARM_THRESH packets that will be accessed contain\npreviously allocated packets.\n\nSetting the bits is not enough. The bits are checked _after_ setting\nthe mbuf fields, thus a mechanism is needed to prevent the previously\nused mbuf pointers from being accessed during the speculative load of\nthe mbuf fields. For this reason, not only the dd bits are reset, but\nalso the mbufs associated to those descriptors are set to point to a\n\"fake\" mbuf.\n\nSigned-off-by: Balazs Nemeth <balazs.nemeth@intel.com>\n---\n lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 19 +++++++++++++++----\n 1 file changed, 15 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c\nindex 203ddf7..457f267 100644\n--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c\n+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c\n@@ -54,17 +54,28 @@ ixgbe_rxq_rearm(struct igb_rx_queue *rxq)\n \tstruct rte_mbuf *mb0, *mb1;\n \t__m128i hdr_room = _mm_set_epi64x(RTE_PKTMBUF_HEADROOM,\n \t\t\tRTE_PKTMBUF_HEADROOM);\n+\t__m128i dma_addr0, dma_addr1;\n+\n+\trxdp = rxq->rx_ring + rxq->rxrearm_start;\n \n \t/* Pull 'n' more MBUFs into the software ring */\n \tif (rte_mempool_get_bulk(rxq->mb_pool,\n-\t\t\t\t (void *)rxep, RTE_IXGBE_RXQ_REARM_THRESH) < 0)\n+\t\t\t\t (void *)rxep,\n+\t\t\t\t RTE_IXGBE_RXQ_REARM_THRESH) < 0) {\n+\t\tif (rxq->rxrearm_nb + RTE_IXGBE_RXQ_REARM_THRESH >=\n+\t\t    rxq->nb_rx_desc) {\n+\t\t\tdma_addr0 = _mm_xor_si128(dma_addr0, dma_addr0);\n+\t\t\tfor (i = 0; i < RTE_IXGBE_DESCS_PER_LOOP; i++) {\n+\t\t\t\trxep[i].mbuf = &rxq->fake_mbuf;\n+\t\t\t\t_mm_store_si128((__m128i *)&rxdp[i].read,\n+\t\t\t\t\t\tdma_addr0);\n+\t\t\t}\n+\t\t}\n \t\treturn;\n-\n-\trxdp = rxq->rx_ring + rxq->rxrearm_start;\n+\t}\n \n \t/* Initialize the mbufs in vector, process 2 mbufs in one loop */\n \tfor (i = 0; i < RTE_IXGBE_RXQ_REARM_THRESH; i += 2, rxep += 2) {\n-\t\t__m128i dma_addr0, dma_addr1;\n \t\t__m128i vaddr0, vaddr1;\n \n \t\tmb0 = rxep[0].mbuf;\n",
    "prefixes": [
        "dpdk-dev"
    ]
}