Show a patch.

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

{
    "id": 41654,
    "url": "http://patches.dpdk.org/api/patches/41654/?format=api",
    "web_url": "http://patches.dpdk.org/patch/41654/",
    "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"
    },
    "msgid": "<1530096938-71399-4-git-send-email-nikhil.rao@intel.com>",
    "date": "2018-06-27T10:55:36",
    "name": "[v2,3/5] eventdev: move Rx adapter eth Rx to separate function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8e478da806f89d0c58cb451f542939c7e4280dfb",
    "submitter": {
        "id": 528,
        "url": "http://patches.dpdk.org/api/people/528/?format=api",
        "name": "Rao, Nikhil",
        "email": "nikhil.rao@intel.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerin.jacob@caviumnetworks.com"
    },
    "mbox": "http://patches.dpdk.org/patch/41654/mbox/",
    "series": [
        {
            "id": 260,
            "url": "http://patches.dpdk.org/api/series/260/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=260",
            "date": "2018-06-27T10:55:33",
            "name": "eventdev: add interrupt driven queues to Rx adapter",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/260/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/41654/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/41654/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,278,1526367600\"; d=\"scan'208\";a=\"52634798\"",
        "X-Amp-File-Uploaded": "False",
        "Precedence": "list",
        "X-Mailman-Version": "2.1.15",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "References": "<1528481718-7241-1-git-send-email-nikhil.rao@intel.com>\n\t<1530096938-71399-1-git-send-email-nikhil.rao@intel.com>",
        "X-BeenThere": "dev@dpdk.org",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH v2 3/5] eventdev: move Rx adapter eth Rx to\n\tseparate function",
        "Sender": "\"dev\" <dev-bounces@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 6948A1BEA4;\n\tWed, 27 Jun 2018 12:56:01 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 4484E1BE2B\n\tfor <dev@dpdk.org>; Wed, 27 Jun 2018 12:55:54 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Jun 2018 03:55:53 -0700",
            "from unknown (HELO localhost.localdomain.localdomain)\n\t([10.224.122.193])\n\tby orsmga008.jf.intel.com with ESMTP; 27 Jun 2018 03:55:52 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-ExtLoop1": "1",
        "Date": "Wed, 27 Jun 2018 16:25:36 +0530",
        "To": "jerin.jacob@caviumnetworks.com",
        "From": "Nikhil Rao <nikhil.rao@intel.com>",
        "In-Reply-To": "<1530096938-71399-1-git-send-email-nikhil.rao@intel.com>",
        "Cc": "nikhil.rao@intel.com,\n\tdev@dpdk.org",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<1530096938-71399-4-git-send-email-nikhil.rao@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "Create a separate function that handles eth receive and\nenqueue to event buffer. This function will also be called for\ninterrupt driven receive queues.\n\nSigned-off-by: Nikhil Rao <nikhil.rao@intel.com>\nAcked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>\n---\n lib/librte_eventdev/rte_event_eth_rx_adapter.c | 67 ++++++++++++++++++--------\n 1 file changed, 47 insertions(+), 20 deletions(-)",
    "diff": "diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c\nindex 926f83a..8fe037f 100644\n--- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c\n+++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c\n@@ -616,6 +616,45 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b)\n \t}\n }\n \n+/* Enqueue packets from  <port, q>  to event buffer */\n+static inline uint32_t\n+rxa_eth_rx(struct rte_event_eth_rx_adapter *rx_adapter,\n+\tuint16_t port_id,\n+\tuint16_t queue_id,\n+\tuint32_t rx_count,\n+\tuint32_t max_rx)\n+{\n+\tstruct rte_mbuf *mbufs[BATCH_SIZE];\n+\tstruct rte_eth_event_enqueue_buffer *buf =\n+\t\t\t\t\t&rx_adapter->event_enqueue_buffer;\n+\tstruct rte_event_eth_rx_adapter_stats *stats =\n+\t\t\t\t\t&rx_adapter->stats;\n+\tuint16_t n;\n+\tuint32_t nb_rx = 0;\n+\n+\t/* Don't do a batch dequeue from the rx queue if there isn't\n+\t * enough space in the enqueue buffer.\n+\t */\n+\twhile (BATCH_SIZE <= (RTE_DIM(buf->events) - buf->count)) {\n+\t\tif (buf->count >= BATCH_SIZE)\n+\t\t\trxa_flush_event_buffer(rx_adapter);\n+\n+\t\tstats->rx_poll_count++;\n+\t\tn = rte_eth_rx_burst(port_id, queue_id, mbufs, BATCH_SIZE);\n+\t\tif (unlikely(!n))\n+\t\t\tbreak;\n+\t\trxa_buffer_mbufs(rx_adapter, port_id, queue_id, mbufs, n);\n+\t\tnb_rx += n;\n+\t\tif (rx_count + nb_rx > max_rx)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (buf->count >= BATCH_SIZE)\n+\t\trxa_flush_event_buffer(rx_adapter);\n+\n+\treturn nb_rx;\n+}\n+\n /*\n  * Polls receive queues added to the event adapter and enqueues received\n  * packets to the event device.\n@@ -633,17 +672,16 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b)\n rxa_poll(struct rte_event_eth_rx_adapter *rx_adapter)\n {\n \tuint32_t num_queue;\n-\tuint16_t n;\n \tuint32_t nb_rx = 0;\n-\tstruct rte_mbuf *mbufs[BATCH_SIZE];\n \tstruct rte_eth_event_enqueue_buffer *buf;\n \tuint32_t wrr_pos;\n \tuint32_t max_nb_rx;\n+\tstruct rte_event_eth_rx_adapter_stats *stats;\n \n \twrr_pos = rx_adapter->wrr_pos;\n \tmax_nb_rx = rx_adapter->max_nb_rx;\n \tbuf = &rx_adapter->event_enqueue_buffer;\n-\tstruct rte_event_eth_rx_adapter_stats *stats = &rx_adapter->stats;\n+\tstats = &rx_adapter->stats;\n \n \t/* Iterate through a WRR sequence */\n \tfor (num_queue = 0; num_queue < rx_adapter->wrr_len; num_queue++) {\n@@ -658,32 +696,21 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b)\n \t\t\trxa_flush_event_buffer(rx_adapter);\n \t\tif (BATCH_SIZE > (ETH_EVENT_BUFFER_SIZE - buf->count)) {\n \t\t\trx_adapter->wrr_pos = wrr_pos;\n-\t\t\treturn;\n+\t\t\tbreak;\n \t\t}\n \n-\t\tstats->rx_poll_count++;\n-\t\tn = rte_eth_rx_burst(d, qid, mbufs, BATCH_SIZE);\n-\n-\t\tif (n) {\n-\t\t\tstats->rx_packets += n;\n-\t\t\t/* The check before rte_eth_rx_burst() ensures that\n-\t\t\t * all n mbufs can be buffered\n-\t\t\t */\n-\t\t\trxa_buffer_mbufs(rx_adapter, d, qid, mbufs, n);\n-\t\t\tnb_rx += n;\n-\t\t\tif (nb_rx > max_nb_rx) {\n-\t\t\t\trx_adapter->wrr_pos =\n+\t\tnb_rx += rxa_eth_rx(rx_adapter, d, qid, nb_rx, max_nb_rx);\n+\t\tif (nb_rx > max_nb_rx) {\n+\t\t\trx_adapter->wrr_pos =\n \t\t\t\t    (wrr_pos + 1) % rx_adapter->wrr_len;\n-\t\t\t\tbreak;\n-\t\t\t}\n+\t\t\tbreak;\n \t\t}\n \n \t\tif (++wrr_pos == rx_adapter->wrr_len)\n \t\t\twrr_pos = 0;\n \t}\n \n-\tif (buf->count >= BATCH_SIZE)\n-\t\trxa_flush_event_buffer(rx_adapter);\n+\tstats->rx_packets += nb_rx;\n }\n \n static int\n",
    "prefixes": [
        "v2",
        "3/5"
    ]
}