get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 43855,
    "url": "http://patches.dpdk.org/api/patches/43855/",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1535115087-2442-2-git-send-email-naga.sureshx.somarowthu@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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": "<1535115087-2442-2-git-send-email-naga.sureshx.somarowthu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1535115087-2442-2-git-send-email-naga.sureshx.somarowthu@intel.com",
    "date": "2018-08-24T12:51:24",
    "name": "[v13,1/4] test: add helper functions for tests using ring-PMD Rx/Tx",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "dbc3b76a40e0b8074140bcd6fad8b3cae8048bc0",
    "submitter": {
        "id": 1053,
        "url": "http://patches.dpdk.org/api/people/1053/",
        "name": "Naga Suresh Somarowthu",
        "email": "naga.sureshx.somarowthu@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1535115087-2442-2-git-send-email-naga.sureshx.somarowthu@intel.com/mbox/",
    "series": [
        {
            "id": 1045,
            "url": "http://patches.dpdk.org/api/series/1045/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1045",
            "date": "2018-08-24T12:51:23",
            "name": "add unit tests for bitrate, latency and pdump libraries",
            "version": 13,
            "mbox": "http://patches.dpdk.org/series/1045/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/43855/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/43855/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "X-BeenThere": "dev@dpdk.org",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "From": "Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>",
        "To": "dev@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "X-Amp-File-Uploaded": "False",
        "References": "<1533299698-20950-1-git-send-email-naga.sureshx.somarowthu@intel.com>\n\t<1535115087-2442-1-git-send-email-naga.sureshx.somarowthu@intel.com>",
        "In-Reply-To": "<1535115087-2442-1-git-send-email-naga.sureshx.somarowthu@intel.com>",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-Mailer": "git-send-email 1.7.12.2",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4E3B34CA9;\n\tFri, 24 Aug 2018 14:51:47 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 154E22C4F\n\tfor <dev@dpdk.org>; Fri, 24 Aug 2018 14:51:41 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t24 Aug 2018 05:51:40 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga004.fm.intel.com with ESMTP; 24 Aug 2018 05:51:39 -0700",
            "from wgcvswdev001.ir.intel.com (wgcvswdev001.ir.intel.com\n\t[10.102.246.100])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tw7OCpdb1031741; Fri, 24 Aug 2018 13:51:39 +0100",
            "from wgcvswdev001.ir.intel.com (localhost [127.0.0.1])\n\tby wgcvswdev001.ir.intel.com with ESMTP id w7OCpWeU002528;\n\tFri, 24 Aug 2018 13:51:32 +0100",
            "(from jmparthx@localhost)\n\tby wgcvswdev001.ir.intel.com with ? id w7OCpWtn002524;\n\tFri, 24 Aug 2018 13:51:32 +0100"
        ],
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Mailman-Version": "2.1.15",
        "X-ExtLoop1": "1",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-IronPort-AV": "E=Sophos;i=\"5.53,281,1531810800\"; d=\"scan'208\";a=\"83102141\"",
        "Subject": "[dpdk-dev] [PATCH v13 1/4] test: add helper functions for tests\n\tusing ring-PMD Rx/Tx",
        "Date": "Fri, 24 Aug 2018 13:51:24 +0100",
        "Message-Id": "<1535115087-2442-2-git-send-email-naga.sureshx.somarowthu@intel.com>",
        "Cc": "reshma.pattan@intel.com,\n\tNaga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>",
        "Precedence": "list"
    },
    "content": "Added ring pmd based packet rx/tx helper functions\nfor verifying Latency, Bitrate and pdump lib UTs.\n\nSigned-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>\nReviewed-by: Reshma Pattan <reshma.pattan@intel.com>\nReviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n MAINTAINERS                       |   5 ++\n test/test/Makefile                |   1 +\n test/test/meson.build             |   1 +\n test/test/sample_packet_forward.c | 114 ++++++++++++++++++++++++++++++++++++++\n test/test/sample_packet_forward.h |  46 +++++++++++++++\n 5 files changed, 167 insertions(+)\n create mode 100644 test/test/sample_packet_forward.c\n create mode 100644 test/test/sample_packet_forward.h",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 9fd258fad..e2e0a27da 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -1176,6 +1176,11 @@ F: test/test/test_resource.c\n F: test/test/virtual_pmd.c\n F: test/test/virtual_pmd.h\n \n+Sample packet helper functions for unit test\n+M: Reshma Pattan <reshma.pattan@intel.com>\n+F: test/test/sample_packet_forward.c\n+F: test/test/sample_packet_forward.h\n+\n Driver testing tool\n M: Wenzhuo Lu <wenzhuo.lu@intel.com>\n M: Jingjing Wu <jingjing.wu@intel.com>\ndiff --git a/test/test/Makefile b/test/test/Makefile\nindex e6967bab6..9f7d398e4 100644\n--- a/test/test/Makefile\n+++ b/test/test/Makefile\n@@ -165,6 +165,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_REORDER) += test_reorder.c\n \n SRCS-y += virtual_pmd.c\n SRCS-y += packet_burst_generator.c\n+SRCS-y += sample_packet_forward.c\n SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c\n \n ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y)\ndiff --git a/test/test/meson.build b/test/test/meson.build\nindex b1dd6eca2..2a7e7d074 100644\n--- a/test/test/meson.build\n+++ b/test/test/meson.build\n@@ -3,6 +3,7 @@\n \n test_sources = files('commands.c',\n \t'packet_burst_generator.c',\n+\t'sample_packet_forward.c',\n \t'test.c',\n \t'test_acl.c',\n \t'test_alarm.c',\ndiff --git a/test/test/sample_packet_forward.c b/test/test/sample_packet_forward.c\nnew file mode 100644\nindex 000000000..61384b3d9\n--- /dev/null\n+++ b/test/test/sample_packet_forward.c\n@@ -0,0 +1,114 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Intel Corporation\n+ */\n+\n+#include <stdio.h>\n+#include <string.h>\n+\n+#include <rte_eth_ring.h>\n+#include <rte_ethdev.h>\n+#include <rte_mbuf.h>\n+#include <rte_bus_vdev.h>\n+#include \"rte_lcore.h\"\n+#include \"rte_mempool.h\"\n+#include \"rte_ring.h\"\n+\n+#include \"sample_packet_forward.h\"\n+\n+/* Sample test to create virtual rings and tx,rx portid from rings */\n+int\n+test_ring_setup(struct rte_ring **ring, uint16_t *portid)\n+{\n+\t*ring = rte_ring_create(\"R0\", RING_SIZE, rte_socket_id(),\n+\t\t\t\t  RING_F_SP_ENQ | RING_F_SC_DEQ);\n+\tif (*ring == NULL) {\n+\t\tprintf(\"%s() line %u: rte_ring_create R0 failed\",\n+\t\t       __func__, __LINE__);\n+\t\treturn -1;\n+\t}\n+\t*portid = rte_eth_from_rings(\"net_ringa\", ring, NUM_QUEUES,\n+\t\t\tring, NUM_QUEUES, rte_socket_id());\n+\n+\treturn 0;\n+}\n+\n+/* Sample test to free the mempool */\n+void\n+test_mp_free(struct rte_mempool *mp)\n+{\n+\trte_mempool_free(mp);\n+}\n+\n+/* Sample test to free the virtual rings */\n+void\n+test_ring_free(struct rte_ring *rxtx)\n+{\n+\trte_ring_free(rxtx);\n+}\n+\n+/* Sample test to release the vdev */\n+void\n+test_vdev_uninit(const char *vdev)\n+{\n+\trte_vdev_uninit(vdev);\n+}\n+\n+/* sample test to allocate the mempool */\n+int\n+test_get_mempool(struct rte_mempool **mp, char *poolname)\n+{\n+\t*mp = rte_pktmbuf_pool_create(poolname, NB_MBUF, 32, 0,\n+\t\t\tRTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());\n+\tif (*mp == NULL)\n+\t\treturn -1;\n+\treturn 0;\n+}\n+\n+/* sample test to allocate buffer for pkts */\n+int\n+test_get_mbuf_from_pool(struct rte_mempool **mp, struct rte_mbuf **pbuf,\n+\t\tchar *poolname)\n+{\n+\tint ret = 0;\n+\n+\tret = test_get_mempool(mp, poolname);\n+\tif (ret < 0)\n+\t\treturn -1;\n+\tif (rte_pktmbuf_alloc_bulk(*mp, pbuf, NUM_PACKETS) != 0) {\n+\t\tprintf(\"%s() line %u: rte_pktmbuf_alloc_bulk failed\", __func__,\n+\t\t       __LINE__);\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n+/* sample test to deallocate the allocated buffers and mempool */\n+void\n+test_put_mbuf_to_pool(struct rte_mempool *mp, struct rte_mbuf **pbuf)\n+{\n+\tint itr = 0;\n+\n+\tfor (itr = 0; itr < NUM_PACKETS; itr++)\n+\t\trte_pktmbuf_free(pbuf[itr]);\n+\trte_mempool_free(mp);\n+}\n+\n+/* Sample test to forward packets using virtual portids */\n+int\n+test_packet_forward(struct rte_mbuf **pbuf, uint16_t portid, uint16_t queue_id)\n+{\n+\t/* send and receive packet and check for stats update */\n+\tif (rte_eth_tx_burst(portid, queue_id, pbuf, NUM_PACKETS)\n+\t\t\t< NUM_PACKETS) {\n+\t\tprintf(\"%s() line %u: Error sending packet to\"\n+\t\t       \" port %d\\n\", __func__, __LINE__, portid);\n+\t\treturn -1;\n+\t}\n+\tif (rte_eth_rx_burst(portid, queue_id, pbuf, NUM_PACKETS)\n+\t\t\t< NUM_PACKETS) {\n+\t\tprintf(\"%s() line %u: Error receiving packet from\"\n+\t\t       \" port %d\\n\", __func__, __LINE__, portid);\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\ndiff --git a/test/test/sample_packet_forward.h b/test/test/sample_packet_forward.h\nnew file mode 100644\nindex 000000000..b2ed618b2\n--- /dev/null\n+++ b/test/test/sample_packet_forward.h\n@@ -0,0 +1,46 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Intel Corporation\n+ */\n+\n+#ifndef _SAMPLE_PACKET_FORWARD_H_\n+#define _SAMPLE_PACKET_FORWARD_H_\n+\n+#include <stdint.h>\n+\n+/* MACROS to support virtual ring creation */\n+#define RING_SIZE 256\n+#define NUM_QUEUES 1\n+#define NB_MBUF 512\n+\n+#define NUM_PACKETS 10\n+\n+struct rte_mbuf;\n+struct rte_mempool;\n+struct rte_ring;\n+\n+/* Sample test to create virtual rings and tx,rx portid from rings */\n+int test_ring_setup(struct rte_ring **ring, uint16_t *portid);\n+\n+/* Sample test to free the virtual rings */\n+void test_ring_free(struct rte_ring *rxtx);\n+\n+/* Sample test to forward packet using virtual port id */\n+int test_packet_forward(struct rte_mbuf **pbuf, uint16_t portid,\n+\t\tuint16_t queue_id);\n+\n+/* sample test to allocate buffer for pkts */\n+int test_get_mbuf_from_pool(struct rte_mempool **mp, struct rte_mbuf **pbuf,\n+\t\tchar *poolname);\n+\n+/* Sample test to create the mempool */\n+int test_get_mempool(struct rte_mempool **mp, char *poolname);\n+\n+/* sample test to deallocate the allocated buffers and mempool */\n+void test_put_mbuf_to_pool(struct rte_mempool *mp, struct rte_mbuf **pbuf);\n+\n+/* Sample test to free the mempool */\n+void test_mp_free(struct rte_mempool *mp);\n+\n+/* Sample test to release the vdev */\n+void test_vdev_uninit(const char *vdev);\n+#endif\t\t\t\t/* _SAMPLE_PACKET_FORWARD_H_ */\n",
    "prefixes": [
        "v13",
        "1/4"
    ]
}