get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8334,
    "url": "http://patches.dpdk.org/api/patches/8334/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1446192187-1890-14-git-send-email-jing.d.chen@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<1446192187-1890-14-git-send-email-jing.d.chen@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1446192187-1890-14-git-send-email-jing.d.chen@intel.com",
    "date": "2015-10-30T08:03:06",
    "name": "[dpdk-dev,v5,13/14] fm10k: fix a crash issue in vector RX func",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "5a24c5fb6422c4e91f6bac463cd0a19be99e94a8",
    "submitter": {
        "id": 40,
        "url": "http://patches.dpdk.org/api/people/40/?format=api",
        "name": "Chen, Jing D",
        "email": "jing.d.chen@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1446192187-1890-14-git-send-email-jing.d.chen@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/8334/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/8334/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 7529291AB;\n\tFri, 30 Oct 2015 09:04:00 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id AE9FE8E80\n\tfor <dev@dpdk.org>; Fri, 30 Oct 2015 09:03:45 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga101.fm.intel.com with ESMTP; 30 Oct 2015 01:03:47 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga002.jf.intel.com with ESMTP; 30 Oct 2015 01:03:44 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t9U83gsq027700;\n\tFri, 30 Oct 2015 16:03:42 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t9U83cK0002015; Fri, 30 Oct 2015 16:03:40 +0800",
            "(from jingche2@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9U83c3U002011; \n\tFri, 30 Oct 2015 16:03:38 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,217,1444719600\"; d=\"scan'208\";a=\"838666396\"",
        "From": "\"Chen Jing D(Mark)\" <jing.d.chen@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 30 Oct 2015 16:03:06 +0800",
        "Message-Id": "<1446192187-1890-14-git-send-email-jing.d.chen@intel.com>",
        "X-Mailer": "git-send-email 1.7.12.2",
        "In-Reply-To": "<1446192187-1890-1-git-send-email-jing.d.chen@intel.com>",
        "References": "<1446110173-13330-2-git-send-email-jing.d.chen@intel.com>\n\t<1446192187-1890-1-git-send-email-jing.d.chen@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5 13/14] fm10k: fix a crash issue in vector RX\n\tfunc",
        "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": "From: \"Chen Jing D(Mark)\" <jing.d.chen@intel.com>\n\nVector RX function will process 4 packets at a time. When the RX\nring wrapps to the tail and the left descriptor size is not multiple\nof 4, SW will overwrite memory that not belongs to it and cause crash.\nThe fix will allocate additional 4 HW/SW spaces at the tail to avoid\noverwrite.\n\nSigned-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>\n---\n drivers/net/fm10k/fm10k.h        |    4 +++-\n drivers/net/fm10k/fm10k_ethdev.c |   19 +++++++++++++++++--\n 2 files changed, 20 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h\nindex 8e2c6a4..82a548f 100644\n--- a/drivers/net/fm10k/fm10k.h\n+++ b/drivers/net/fm10k/fm10k.h\n@@ -177,7 +177,7 @@ struct fm10k_rx_queue {\n \tstruct rte_mbuf *pkt_last_seg;  /* Last segment of current packet. */\n \tuint64_t hw_ring_phys_addr;\n \tuint64_t mbuf_initializer; /* value to init mbufs */\n-\t/** need to alloc dummy mbuf, for wraparound when scanning hw ring */\n+\t/* need to alloc dummy mbuf, for wraparound when scanning hw ring */\n \tstruct rte_mbuf fake_mbuf;\n \tuint16_t next_dd;\n \tuint16_t next_alloc;\n@@ -185,6 +185,8 @@ struct fm10k_rx_queue {\n \tuint16_t alloc_thresh;\n \tvolatile uint32_t *tail_ptr;\n \tuint16_t nb_desc;\n+\t/* Number of faked desc added at the tail for Vector RX function */\n+\tuint16_t nb_fake_desc;\n \tuint16_t queue_id;\n \t/* Below 2 fields only valid in case vPMD is applied. */\n \tuint16_t rxrearm_nb;     /* number of remaining to be re-armed */\ndiff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c\nindex 05ed90d..dde067f 100644\n--- a/drivers/net/fm10k/fm10k_ethdev.c\n+++ b/drivers/net/fm10k/fm10k_ethdev.c\n@@ -102,6 +102,7 @@ fm10k_mbx_unlock(struct fm10k_hw *hw)\n static inline int\n rx_queue_reset(struct fm10k_rx_queue *q)\n {\n+\tstatic const union fm10k_rx_desc zero = {{0} };\n \tuint64_t dma_addr;\n \tint i, diag;\n \tPMD_INIT_FUNC_TRACE();\n@@ -122,6 +123,15 @@ rx_queue_reset(struct fm10k_rx_queue *q)\n \t\tq->hw_ring[i].q.hdr_addr = dma_addr;\n \t}\n \n+\t/* initialize extra software ring entries. Space for these extra\n+\t * entries is always allocated.\n+\t */\n+\tmemset(&q->fake_mbuf, 0x0, sizeof(q->fake_mbuf));\n+\tfor (i = 0; i < q->nb_fake_desc; ++i) {\n+\t\tq->sw_ring[q->nb_desc + i] = &q->fake_mbuf;\n+\t\tq->hw_ring[q->nb_desc + i] = zero;\n+\t}\n+\n \tq->next_dd = 0;\n \tq->next_alloc = 0;\n \tq->next_trigger = q->alloc_thresh - 1;\n@@ -147,6 +157,10 @@ rx_queue_clean(struct fm10k_rx_queue *q)\n \tfor (i = 0; i < q->nb_desc; ++i)\n \t\tq->hw_ring[i] = zero;\n \n+\t/* zero faked descriptors */\n+\tfor (i = 0; i < q->nb_fake_desc; ++i)\n+\t\tq->hw_ring[q->nb_desc + i] = zero;\n+\n \t/* vPMD driver has a different way of releasing mbufs. */\n \tif (q->rx_using_sse) {\n \t\tfm10k_rx_queue_release_mbufs_vec(q);\n@@ -1326,6 +1340,7 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,\n \t/* setup queue */\n \tq->mp = mp;\n \tq->nb_desc = nb_desc;\n+\tq->nb_fake_desc = FM10K_MULT_RX_DESC;\n \tq->port_id = dev->data->port_id;\n \tq->queue_id = queue_id;\n \tq->tail_ptr = (volatile uint32_t *)\n@@ -1335,8 +1350,8 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,\n \n \t/* allocate memory for the software ring */\n \tq->sw_ring = rte_zmalloc_socket(\"fm10k sw ring\",\n-\t\t\t\t\tnb_desc * sizeof(struct rte_mbuf *),\n-\t\t\t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n+\t\t\t(nb_desc + q->nb_fake_desc) * sizeof(struct rte_mbuf *),\n+\t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (q->sw_ring == NULL) {\n \t\tPMD_INIT_LOG(ERR, \"Cannot allocate software ring\");\n \t\trte_free(q);\n",
    "prefixes": [
        "dpdk-dev",
        "v5",
        "13/14"
    ]
}