Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/43302/?format=api
http://patches.dpdk.org/api/patches/43302/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1532429671-1606-2-git-send-email-naga.sureshx.somarowthu@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": "<1532429671-1606-2-git-send-email-naga.sureshx.somarowthu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1532429671-1606-2-git-send-email-naga.sureshx.somarowthu@intel.com", "date": "2018-07-24T10:54:28", "name": "[v5,1/4] test: add ring pmd based packet rx/tx for UT", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "cee498fb142dace642790bfee8d242dc3dc7d4f6", "submitter": { "id": 1053, "url": "http://patches.dpdk.org/api/people/1053/?format=api", "name": "Naga Suresh Somarowthu", "email": "naga.sureshx.somarowthu@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1532429671-1606-2-git-send-email-naga.sureshx.somarowthu@intel.com/mbox/", "series": [ { "id": 737, "url": "http://patches.dpdk.org/api/series/737/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=737", "date": "2018-07-24T10:54:27", "name": "add unit tests for bitrate, latency and pdump libraries", "version": 5, "mbox": "http://patches.dpdk.org/series/737/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/43302/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/43302/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 350E2326C;\n\tTue, 24 Jul 2018 12:55:13 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id DAA041DA4\n\tfor <dev@dpdk.org>; Tue, 24 Jul 2018 12:55:10 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t24 Jul 2018 03:55:09 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga005.fm.intel.com with ESMTP; 24 Jul 2018 03:54:51 -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\tw6OAsp07013920; Tue, 24 Jul 2018 11:54:51 +0100", "from wgcvswdev001.ir.intel.com (localhost [127.0.0.1])\n\tby wgcvswdev001.ir.intel.com with ESMTP id w6OAsn7x001749;\n\tTue, 24 Jul 2018 11:54:49 +0100", "(from jmparthx@localhost)\n\tby wgcvswdev001.ir.intel.com with ? id w6OAsnxO001745;\n\tTue, 24 Jul 2018 11:54:49 +0100" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.51,397,1526367600\"; d=\"scan'208\";a=\"247880913\"", "From": "Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>", "To": "dev@dpdk.org", "Cc": "remy.horton@intel.com, reshma.pattan@intel.com,\n\tNaga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>", "Date": "Tue, 24 Jul 2018 11:54:28 +0100", "Message-Id": "<1532429671-1606-2-git-send-email-naga.sureshx.somarowthu@intel.com>", "X-Mailer": "git-send-email 1.7.12.2", "In-Reply-To": "<1532429671-1606-1-git-send-email-naga.sureshx.somarowthu@intel.com>", "References": "<1531821650-5506-1-git-send-email-jananeex.m.parthasarathy@intel.com>\n\t<1532429671-1606-1-git-send-email-naga.sureshx.somarowthu@intel.com>", "Subject": "[dpdk-dev] [PATCH v5 1/4] test: add ring pmd based packet rx/tx for\n\tUT", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "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 test/test/Makefile | 1 +\n test/test/sample_packet_forward.c | 115 ++++++++++++++++++++++++++++++++++++++\n test/test/sample_packet_forward.h | 41 ++++++++++++++\n 3 files changed, 157 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/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/sample_packet_forward.c b/test/test/sample_packet_forward.c\nnew file mode 100644\nindex 000000000..8f9d7009a\n--- /dev/null\n+++ b/test/test/sample_packet_forward.c\n@@ -0,0 +1,115 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Intel Corporation\n+ */\n+\n+#include <string.h>\n+#include <errno.h>\n+#include <time.h>\n+\n+#include <rte_memcpy.h>\n+#include <rte_common.h>\n+#include <rte_eth_ring.h>\n+#include <rte_ethdev.h>\n+#include <rte_mbuf.h>\n+#include <rte_bus_vdev.h>\n+\n+#include \"sample_packet_forward.h\"\n+#include \"test.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+\tring[0] = 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[0] == NULL) {\n+\t\tprintf(\"%s() line %u: rte_ring_create R0 failed\",\n+\t\t __func__, __LINE__);\n+\t\treturn TEST_FAILED;\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 TEST_SUCCESS;\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 deallocate the allocated buffers */\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 TEST_FAILED;\n+\treturn TEST_SUCCESS;\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 TEST_FAILED;\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 TEST_FAILED;\n+\t}\n+\treturn TEST_SUCCESS;\n+}\n+\n+/* sample test to deallocate the allocated buffers */\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 TEST_FAILED;\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 TEST_FAILED;\n+\t}\n+\treturn TEST_SUCCESS;\n+}\ndiff --git a/test/test/sample_packet_forward.h b/test/test/sample_packet_forward.h\nnew file mode 100644\nindex 000000000..1293ee0a8\n--- /dev/null\n+++ b/test/test/sample_packet_forward.h\n@@ -0,0 +1,41 @@\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+/* MACROS to support virtual ring creation */\n+#define RING_SIZE 256\n+#define NUM_RINGS 1\n+#define NUM_QUEUES 1\n+#define NB_MBUF 512\n+\n+#define NUM_PACKETS 10\n+\n+/* Sample test to create virtual rings and tx,rx portid from rings */\n+int test_ring_setup(struct rte_ring *ring_server[], 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 */\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": [ "v5", "1/4" ] }{ "id": 43302, "url": "