Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/52264/?format=api
http://patches.dpdk.org/api/patches/52264/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190404085515.15789-3-vipin.varghese@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": "<20190404085515.15789-3-vipin.varghese@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190404085515.15789-3-vipin.varghese@intel.com", "date": "2019-04-04T08:55:15", "name": "[v6,2/2] app/pdump: enhance to support multi-core capture", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "a822d61f5b7ec95da154dbcd45a870bafbd91a4b", "submitter": { "id": 882, "url": "http://patches.dpdk.org/api/people/882/?format=api", "name": "Varghese, Vipin", "email": "vipin.varghese@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190404085515.15789-3-vipin.varghese@intel.com/mbox/", "series": [ { "id": 4107, "url": "http://patches.dpdk.org/api/series/4107/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4107", "date": "2019-04-04T08:55:13", "name": "app/pdump: enhance to support unique cores", "version": 6, "mbox": "http://patches.dpdk.org/series/4107/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/52264/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/52264/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 D2AC25F2D;\n\tThu, 4 Apr 2019 10:55:01 +0200 (CEST)", "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n\tby dpdk.org (Postfix) with ESMTP id 1A9BE5F29\n\tfor <dev@dpdk.org>; Thu, 4 Apr 2019 10:54:58 +0200 (CEST)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t04 Apr 2019 01:54:58 -0700", "from unknown (HELO saesrv02-S2600CWR.intel.com) ([10.224.122.203])\n\tby FMSMGA003.fm.intel.com with ESMTP; 04 Apr 2019 01:54:55 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.60,306,1549958400\"; d=\"scan'208\";a=\"146518239\"", "From": "Vipin Varghese <vipin.varghese@intel.com>", "To": "dev@dpdk.org, marko.kovacevic@intel.com, reshma.pattan@intel.com,\n\tdavid.marchand@redhat.com", "Cc": "keith.wiles@intel.com, john.mcnamara@intel.com, stephen1.byrne@intel.com,\n\tamit.tamboli@intel.com, sanjay.padubidri@intel.com,\n\tamol.patel@intel.com, Vipin Varghese <vipin.varghese@intel.com>", "Date": "Thu, 4 Apr 2019 14:25:15 +0530", "Message-Id": "<20190404085515.15789-3-vipin.varghese@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190404085515.15789-1-vipin.varghese@intel.com>", "References": "<20190402091836.35779-3-vipin.varghese@intel.com>\n\t<20190404085515.15789-1-vipin.varghese@intel.com>", "Subject": "[dpdk-dev] [PATCH v6 2/2] app/pdump: enhance to support multi-core\n\tcapture", "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": "Add option --multi, to enhance pdump application to allow capture\non unique cores for each --pdump option. If option --multi is ignored\nthe default capture occurs on single core for all --pdump options.\n\nSigned-off-by: Vipin Varghese <vipin.varghese@intel.com>\n---\n app/pdump/main.c | 99 ++++++++++++++++++++++++++++++--------\n doc/guides/tools/pdump.rst | 8 ++-\n 2 files changed, 85 insertions(+), 22 deletions(-)", "diff": "diff --git a/app/pdump/main.c b/app/pdump/main.c\nindex c1db2eb8d..ae2c01b7b 100644\n--- a/app/pdump/main.c\n+++ b/app/pdump/main.c\n@@ -28,6 +28,9 @@\n #include <rte_pdump.h>\n \n #define CMD_LINE_OPT_PDUMP \"pdump\"\n+#define CMD_LINE_OPT_PDUMP_NUM 256\n+#define CMD_LINE_OPT_MULTI \"multi\"\n+#define CMD_LINE_OPT_MULTI_NUM 257\n #define PDUMP_PORT_ARG \"port\"\n #define PDUMP_PCI_ARG \"device_id\"\n #define PDUMP_QUEUE_ARG \"queue\"\n@@ -139,12 +142,15 @@ struct parse_val {\n static int num_tuples;\n static struct rte_eth_conf port_conf_default;\n static volatile uint8_t quit_signal;\n+static uint8_t multiple_core_capture;\n \n /**< display usage */\n static void\n pdump_usage(const char *prgname)\n {\n-\tprintf(\"usage: %s [EAL options] -- --pdump \"\n+\tprintf(\"usage: %s [EAL options]\"\n+\t\t\t\" --[\"CMD_LINE_OPT_MULTI\"]\\n\"\n+\t\t\t\" --\"CMD_LINE_OPT_PDUMP\" \"\n \t\t\t\"'(port=<port id> | device_id=<pci id or vdev name>),\"\n \t\t\t\"(queue=<queue_id>),\"\n \t\t\t\"(rx-dev=<iface or pcap file> |\"\n@@ -375,7 +381,8 @@ launch_args_parse(int argc, char **argv, char *prgname)\n \tint opt, ret;\n \tint option_index;\n \tstatic struct option long_option[] = {\n-\t\t{\"pdump\", 1, 0, 0},\n+\t\t{CMD_LINE_OPT_PDUMP, 1, 0, CMD_LINE_OPT_PDUMP_NUM},\n+\t\t{CMD_LINE_OPT_MULTI, 0, 0, CMD_LINE_OPT_MULTI_NUM},\n \t\t{NULL, 0, 0, 0}\n \t};\n \n@@ -386,17 +393,16 @@ launch_args_parse(int argc, char **argv, char *prgname)\n \twhile ((opt = getopt_long(argc, argv, \" \",\n \t\t\tlong_option, &option_index)) != EOF) {\n \t\tswitch (opt) {\n-\t\tcase 0:\n-\t\t\tif (!strncmp(long_option[option_index].name,\n-\t\t\t\t\tCMD_LINE_OPT_PDUMP,\n-\t\t\t\t\tsizeof(CMD_LINE_OPT_PDUMP))) {\n-\t\t\t\tret = parse_pdump(optarg);\n-\t\t\t\tif (ret) {\n-\t\t\t\t\tpdump_usage(prgname);\n-\t\t\t\t\treturn -1;\n-\t\t\t\t}\n+\t\tcase CMD_LINE_OPT_PDUMP_NUM:\n+\t\t\tret = parse_pdump(optarg);\n+\t\t\tif (ret) {\n+\t\t\t\tpdump_usage(prgname);\n+\t\t\t\treturn -1;\n \t\t\t}\n \t\t\tbreak;\n+\t\tcase CMD_LINE_OPT_MULTI_NUM:\n+\t\t\tmultiple_core_capture = 1;\n+\t\t\tbreak;\n \t\tdefault:\n \t\t\tpdump_usage(prgname);\n \t\t\treturn -1;\n@@ -834,23 +840,74 @@ enable_pdump(void)\n \t}\n }\n \n+static inline void\n+pdump_packets(struct pdump_tuples *pt)\n+{\n+\tif (pt->dir & RTE_PDUMP_FLAG_RX)\n+\t\tpdump_rxtx(pt->rx_ring, pt->rx_vdev_id, &pt->stats);\n+\tif (pt->dir & RTE_PDUMP_FLAG_TX)\n+\t\tpdump_rxtx(pt->tx_ring, pt->tx_vdev_id, &pt->stats);\n+}\n+\n+static int\n+dump_packets_core(void *arg)\n+{\n+\tstruct pdump_tuples *pt = (struct pdump_tuples *) arg;\n+\n+\tprintf(\" core (%u); port %u device (%s) queue %u\\n\",\n+\t\t\trte_lcore_id(), pt->port, pt->device_id, pt->queue);\n+\tfflush(stdout);\n+\n+\twhile (!quit_signal)\n+\t\tpdump_packets(pt);\n+\n+\treturn 0;\n+}\n+\n static inline void\n dump_packets(void)\n {\n \tint i;\n-\tstruct pdump_tuples *pt;\n+\tuint32_t lcore_id = 0;\n+\n+\tif (!multiple_core_capture) {\n+\t\tprintf(\" core (%u), capture for (%d) tuples\\n\",\n+\t\t\t\trte_lcore_id(), num_tuples);\n+\n+\t\tfor (i = 0; i < num_tuples; i++)\n+\t\t\tprintf(\" - port %u device (%s) queue %u\\n\",\n+\t\t\t\tpdump_t[i].port,\n+\t\t\t\tpdump_t[i].device_id,\n+\t\t\t\tpdump_t[i].queue);\n \n-\twhile (!quit_signal) {\n-\t\tfor (i = 0; i < num_tuples; i++) {\n-\t\t\tpt = &pdump_t[i];\n-\t\t\tif (pt->dir & RTE_PDUMP_FLAG_RX)\n-\t\t\t\tpdump_rxtx(pt->rx_ring, pt->rx_vdev_id,\n-\t\t\t\t\t&pt->stats);\n-\t\t\tif (pt->dir & RTE_PDUMP_FLAG_TX)\n-\t\t\t\tpdump_rxtx(pt->tx_ring, pt->tx_vdev_id,\n-\t\t\t\t\t&pt->stats);\n+\t\twhile (!quit_signal) {\n+\t\t\tfor (i = 0; i < num_tuples; i++)\n+\t\t\t\tpdump_packets(&pdump_t[i]);\n \t\t}\n+\n+\t\treturn;\n+\t}\n+\n+\t/* check if there enough core */\n+\tif ((uint32_t)num_tuples >= rte_lcore_count()) {\n+\t\tprintf(\"Insufficient cores to run parallel!\\n\");\n+\t\treturn;\n \t}\n+\n+\tlcore_id = rte_get_next_lcore(lcore_id, 1, 0);\n+\n+\tfor (i = 0; i < num_tuples; i++) {\n+\t\trte_eal_remote_launch(dump_packets_core,\n+\t\t\t\t&pdump_t[i], lcore_id);\n+\t\tlcore_id = rte_get_next_lcore(lcore_id, 1, 0);\n+\n+\t\tif (rte_eal_wait_lcore(lcore_id) < 0)\n+\t\t\trte_exit(EXIT_FAILURE, \"failed to wait\\n\");\n+\t}\n+\n+\t/* master core */\n+\twhile (!quit_signal)\n+\t\t;\n }\n \n int\ndiff --git a/doc/guides/tools/pdump.rst b/doc/guides/tools/pdump.rst\nindex 7c2b73e72..53cd2b464 100644\n--- a/doc/guides/tools/pdump.rst\n+++ b/doc/guides/tools/pdump.rst\n@@ -35,6 +35,7 @@ The tool has a number of command line options:\n .. code-block:: console\n \n ./build/app/dpdk-pdump --\n+ [--multi]\n --pdump '(port=<port id> | device_id=<pci id or vdev name>),\n (queue=<queue_id>),\n (rx-dev=<iface or pcap file> |\n@@ -43,6 +44,10 @@ The tool has a number of command line options:\n [mbuf-size=<mbuf data size>],\n [total-num-mbufs=<number of mbufs>]'\n \n+The ``--multi`` command line option is optional argument. If passed, capture\n+will be running on unique cores for all ``--pdump`` options. If ignored,\n+capture will be running on single core for all ``--pdump`` options.\n+\n The ``--pdump`` command line option is mandatory and it takes various sub arguments which are described in\n below section.\n \n@@ -112,4 +117,5 @@ Example\n \n .. code-block:: console\n \n- $ sudo ./build/app/dpdk-pdump -- --pdump 'port=0,queue=*,rx-dev=/tmp/rx.pcap'\n+ $ sudo ./build/app/dpdk-pdump -l 3 -- --pdump 'port=0,queue=*,rx-dev=/tmp/rx.pcap'\n+ $ sudo ./build/app/dpdk-pdump -l 3,4,5 -- --multi --pdump 'port=0,queue=*,rx-dev=/tmp/rx-1.pcap' --pdump 'port=1,queue=*,rx-dev=/tmp/rx-2.pcap'\n", "prefixes": [ "v6", "2/2" ] }{ "id": 52264, "url": "