get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 17237,
    "url": "https://patches.dpdk.org/api/patches/17237/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1479981261-19512-7-git-send-email-olivier.matz@6wind.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": "<1479981261-19512-7-git-send-email-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1479981261-19512-7-git-send-email-olivier.matz@6wind.com",
    "date": "2016-11-24T09:54:18",
    "name": "[dpdk-dev,RFC,6/9] net/igb: optimize rx queue descriptor count",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e34b6823ccd1e8043757e630615e1d6558ff8c65",
    "submitter": {
        "id": 8,
        "url": "https://patches.dpdk.org/api/people/8/?format=api",
        "name": "Olivier Matz",
        "email": "olivier.matz@6wind.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1479981261-19512-7-git-send-email-olivier.matz@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/17237/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/17237/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 36C0358EB;\n\tThu, 24 Nov 2016 11:00:38 +0100 (CET)",
            "from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com\n\t[62.23.145.76]) by dpdk.org (Postfix) with ESMTP id CD0F247CD\n\tfor <dev@dpdk.org>; Thu, 24 Nov 2016 10:59:38 +0100 (CET)",
            "from glumotte.dev.6wind.com (unknown [10.16.0.195])\n\tby proxy.6wind.com (Postfix) with ESMTP id 62F17278EF;\n\tThu, 24 Nov 2016 10:59:34 +0100 (CET)"
        ],
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas.monjalon@6wind.com, konstantin.ananyev@intel.com,\n\twenzhuo.lu@intel.com, helin.zhang@intel.com",
        "Date": "Thu, 24 Nov 2016 10:54:18 +0100",
        "Message-Id": "<1479981261-19512-7-git-send-email-olivier.matz@6wind.com>",
        "X-Mailer": "git-send-email 2.8.1",
        "In-Reply-To": "<1479981261-19512-1-git-send-email-olivier.matz@6wind.com>",
        "References": "<1479981261-19512-1-git-send-email-olivier.matz@6wind.com>",
        "Subject": "[dpdk-dev] [RFC 6/9] net/igb: optimize rx queue descriptor count",
        "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": "Use a binary search algorithm to find the first empty DD bit. The\nring-empty and ring-full cases are managed separately as they are more\nlikely to happen.\n\nPR=52423\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\nAcked-by: Ivan Boule <ivan.boule@6wind.com>\n---\n drivers/net/e1000/igb_rxtx.c | 55 +++++++++++++++++++++++++++++++++-----------\n 1 file changed, 41 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c\nindex e9aa356..6b0111f 100644\n--- a/drivers/net/e1000/igb_rxtx.c\n+++ b/drivers/net/e1000/igb_rxtx.c\n@@ -1507,24 +1507,51 @@ eth_igb_rx_queue_setup(struct rte_eth_dev *dev,\n uint32_t\n eth_igb_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n {\n-#define IGB_RXQ_SCAN_INTERVAL 4\n-\tvolatile union e1000_adv_rx_desc *rxdp;\n+\tvolatile uint32_t *status;\n \tstruct igb_rx_queue *rxq;\n-\tuint32_t desc = 0;\n+\tuint32_t offset, interval, resolution;\n+\tint32_t idx;\n \n \trxq = dev->data->rx_queues[rx_queue_id];\n-\trxdp = &(rxq->rx_ring[rxq->rx_tail]);\n-\n-\twhile ((desc < rxq->nb_rx_desc) &&\n-\t\t(rxdp->wb.upper.status_error & E1000_RXD_STAT_DD)) {\n-\t\tdesc += IGB_RXQ_SCAN_INTERVAL;\n-\t\trxdp += IGB_RXQ_SCAN_INTERVAL;\n-\t\tif (rxq->rx_tail + desc >= rxq->nb_rx_desc)\n-\t\t\trxdp = &(rxq->rx_ring[rxq->rx_tail +\n-\t\t\t\tdesc - rxq->nb_rx_desc]);\n-\t}\n \n-\treturn desc;\n+\t/* check if ring empty */\n+\tidx = rxq->rx_tail;\n+\tstatus = &rxq->rx_ring[idx].wb.upper.status_error;\n+\tif (!(*status & rte_cpu_to_le_32(E1000_RXD_STAT_DD)))\n+\t\treturn 0;\n+\n+\t/* decrease the precision if ring is large */\n+\tif (rxq->nb_rx_desc <= 256)\n+\t\tresolution = 4;\n+\telse\n+\t\tresolution = 16;\n+\n+\t/* check if ring full */\n+\tidx = rxq->rx_tail - rxq->nb_rx_hold - resolution;\n+\tif (idx < 0)\n+\t\tidx += rxq->nb_rx_desc;\n+\tstatus = &rxq->rx_ring[idx].wb.upper.status_error;\n+\tif (*status & rte_cpu_to_le_32(E1000_RXD_STAT_DD))\n+\t\treturn rxq->nb_rx_desc;\n+\n+\t/* use a binary search */\n+\tinterval = (rxq->nb_rx_desc - rxq->nb_rx_hold) >> 1;\n+\toffset = interval;\n+\n+\tdo {\n+\t\tidx = rxq->rx_tail + offset;\n+\t\tif (idx >= rxq->nb_rx_desc)\n+\t\t\tidx -= rxq->nb_rx_desc;\n+\n+\t\tinterval >>= 1;\n+\t\tstatus = &rxq->rx_ring[idx].wb.upper.status_error;\n+\t\tif (*status & rte_cpu_to_le_32(E1000_RXD_STAT_DD))\n+\t\t\toffset += interval;\n+\t\telse\n+\t\t\toffset -= interval;\n+\t} while (interval >= resolution);\n+\n+\treturn offset;\n }\n \n int\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "6/9"
    ]
}