get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 78674,
    "url": "https://patches.dpdk.org/api/patches/78674/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200924113414.483-1-irusskikh@marvell.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": "<20200924113414.483-1-irusskikh@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200924113414.483-1-irusskikh@marvell.com",
    "date": "2020-09-24T11:34:14",
    "name": "[RFC] app/testpmd: tx pkt clones parameter in flowgen",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6a7396a3876da07967f51c76b43ab257ee8438fc",
    "submitter": {
        "id": 1972,
        "url": "https://patches.dpdk.org/api/people/1972/?format=api",
        "name": "Igor Russkikh",
        "email": "irusskikh@marvell.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200924113414.483-1-irusskikh@marvell.com/mbox/",
    "series": [
        {
            "id": 12469,
            "url": "https://patches.dpdk.org/api/series/12469/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=12469",
            "date": "2020-09-24T11:34:14",
            "name": "[RFC] app/testpmd: tx pkt clones parameter in flowgen",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/12469/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/78674/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/78674/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id F230EA04B1;\n\tThu, 24 Sep 2020 13:34:30 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7A6B61DDC7;\n\tThu, 24 Sep 2020 13:34:30 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id DA2561D671\n for <dev@dpdk.org>; Thu, 24 Sep 2020 13:34:28 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 08OBU5Np003210; Thu, 24 Sep 2020 04:34:28 -0700",
            "from sc-exch03.marvell.com ([199.233.58.183])\n by mx0a-0016f401.pphosted.com with ESMTP id 33nfbq4c7g-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Thu, 24 Sep 2020 04:34:27 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH03.marvell.com\n (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Thu, 24 Sep 2020 04:34:26 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Thu, 24 Sep 2020 04:34:25 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Thu, 24 Sep 2020 04:34:25 -0700",
            "from NN-LT0019.marvell.com (NN-LT0019.marvell.com [10.193.39.7])\n by maili.marvell.com (Postfix) with ESMTP id 6D8933F7040;\n Thu, 24 Sep 2020 04:34:23 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : mime-version : content-type; s=pfpt0220;\n bh=UgbK9XNGsG8nQYWFIsk61JQGul2Hv2ZXJj074rgk+9M=;\n b=Nq7QKf4dJnME7tGZ9GAykQGp9JWoSUlbxnkNVMmld9ncDkM9PCSxwXSrwZYQmJuYgcca\n iJh2fxcF0y2ST18t8w9BUr9m/FFbgVNCsaD8CYBi29jRgFNAHmZo4ErwNCWdMRbjqsHO\n yafrT1AzEZnNVv9iwjqVHEyo/SPyBveEsykZUqqk9kKsZY7nvVJNXUEKqkp9oT1iQAUY\n WaM/ycp51/+WTENpy6cDp9BDmKrYPoGdSudHfZOgLNQleVYZiRQSlWWEEEkAbYWJPBEE\n siVTQZEZtM+h4N4B2Avm8kMfJjLCdmy4Ks84ZjbHfMPfRIVek1Ac9vQMwFr2os91qiyL 0A==",
        "From": "Igor Russkikh <irusskikh@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Rasesh Mody <rmody@marvell.com>, Devendra Singh Rawat\n <dsinghrawat@marvell.com>, Wenzhuo Lu <wenzhuo.lu@intel.com>, Beilei Xing\n <beilei.xing@intel.com>, Bernard Iremonger <bernard.iremonger@intel.com>,\n Igor Russkikh <irusskikh@marvell.com>",
        "Date": "Thu, 24 Sep 2020 14:34:14 +0300",
        "Message-ID": "<20200924113414.483-1-irusskikh@marvell.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687\n definitions=2020-09-24_08:2020-09-24,\n 2020-09-24 signatures=0",
        "Subject": "[dpdk-dev] [RFC PATCH] app/testpmd: tx pkt clones parameter in\n\tflowgen",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "When testing high performance numbers, it is often that CPU performance\nlimits the max values device can reach (both in pps and in gbps)\n\nHere instead of recreating each packet separately, we use clones counter\nto resend the same mbuf to the line multiple times.\n\nPMDs handle that transparently due to reference counting inside of mbuf.\n\nVerified on Marvell qede and atlantic PMDs.\n\nSigned-off-by: Igor Russkikh <irusskikh@marvell.com>\n---\n app/test-pmd/flowgen.c                | 100 ++++++++++++++------------\n app/test-pmd/parameters.c             |  12 ++++\n app/test-pmd/testpmd.c                |   1 +\n app/test-pmd/testpmd.h                |   1 +\n doc/guides/testpmd_app_ug/run_app.rst |   7 ++\n 5 files changed, 74 insertions(+), 47 deletions(-)",
    "diff": "diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c\nindex acf3e2460..b6f6e7a0e 100644\n--- a/app/test-pmd/flowgen.c\n+++ b/app/test-pmd/flowgen.c\n@@ -94,6 +94,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)\n \tuint16_t nb_rx;\n \tuint16_t nb_tx;\n \tuint16_t nb_pkt;\n+\tuint16_t nb_clones = nb_pkt_clones;\n \tuint16_t i;\n \tuint32_t retry;\n \tuint64_t tx_offloads;\n@@ -123,53 +124,58 @@ pkt_burst_flow_gen(struct fwd_stream *fs)\n \t\tol_flags |= PKT_TX_MACSEC;\n \n \tfor (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) {\n-\t\tpkt = rte_mbuf_raw_alloc(mbp);\n-\t\tif (!pkt)\n-\t\t\tbreak;\n-\n-\t\tpkt->data_len = pkt_size;\n-\t\tpkt->next = NULL;\n-\n-\t\t/* Initialize Ethernet header. */\n-\t\teth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);\n-\t\trte_ether_addr_copy(&cfg_ether_dst, &eth_hdr->d_addr);\n-\t\trte_ether_addr_copy(&cfg_ether_src, &eth_hdr->s_addr);\n-\t\teth_hdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);\n-\n-\t\t/* Initialize IP header. */\n-\t\tip_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);\n-\t\tmemset(ip_hdr, 0, sizeof(*ip_hdr));\n-\t\tip_hdr->version_ihl\t= RTE_IPV4_VHL_DEF;\n-\t\tip_hdr->type_of_service\t= 0;\n-\t\tip_hdr->fragment_offset\t= 0;\n-\t\tip_hdr->time_to_live\t= IP_DEFTTL;\n-\t\tip_hdr->next_proto_id\t= IPPROTO_UDP;\n-\t\tip_hdr->packet_id\t= 0;\n-\t\tip_hdr->src_addr\t= rte_cpu_to_be_32(cfg_ip_src);\n-\t\tip_hdr->dst_addr\t= rte_cpu_to_be_32(cfg_ip_dst +\n-\t\t\t\t\t\t\t   next_flow);\n-\t\tip_hdr->total_length\t= RTE_CPU_TO_BE_16(pkt_size -\n-\t\t\t\t\t\t\t   sizeof(*eth_hdr));\n-\t\tip_hdr->hdr_checksum\t= ip_sum((unaligned_uint16_t *)ip_hdr,\n-\t\t\t\t\t\t sizeof(*ip_hdr));\n-\n-\t\t/* Initialize UDP header. */\n-\t\tudp_hdr = (struct rte_udp_hdr *)(ip_hdr + 1);\n-\t\tudp_hdr->src_port\t= rte_cpu_to_be_16(cfg_udp_src);\n-\t\tudp_hdr->dst_port\t= rte_cpu_to_be_16(cfg_udp_dst);\n-\t\tudp_hdr->dgram_cksum\t= 0; /* No UDP checksum. */\n-\t\tudp_hdr->dgram_len\t= RTE_CPU_TO_BE_16(pkt_size -\n-\t\t\t\t\t\t\t   sizeof(*eth_hdr) -\n-\t\t\t\t\t\t\t   sizeof(*ip_hdr));\n-\t\tpkt->nb_segs\t\t= 1;\n-\t\tpkt->pkt_len\t\t= pkt_size;\n-\t\tpkt->ol_flags\t\t&= EXT_ATTACHED_MBUF;\n-\t\tpkt->ol_flags\t\t|= ol_flags;\n-\t\tpkt->vlan_tci\t\t= vlan_tci;\n-\t\tpkt->vlan_tci_outer\t= vlan_tci_outer;\n-\t\tpkt->l2_len\t\t= sizeof(struct rte_ether_hdr);\n-\t\tpkt->l3_len\t\t= sizeof(struct rte_ipv4_hdr);\n-\t\tpkts_burst[nb_pkt]\t= pkt;\n+\t\tif (!nb_pkt || !nb_clones) {\n+\t\t\tnb_clones = nb_pkt_clones;\n+\t\t\tpkt = rte_mbuf_raw_alloc(mbp);\n+\t\t\tif (!pkt)\n+\t\t\t\tbreak;\n+\n+\t\t\tpkt->data_len = pkt_size;\n+\t\t\tpkt->next = NULL;\n+\n+\t\t\t/* Initialize Ethernet header. */\n+\t\t\teth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);\n+\t\t\trte_ether_addr_copy(&cfg_ether_dst, &eth_hdr->d_addr);\n+\t\t\trte_ether_addr_copy(&cfg_ether_src, &eth_hdr->s_addr);\n+\t\t\teth_hdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);\n+\n+\t\t\t/* Initialize IP header. */\n+\t\t\tip_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);\n+\t\t\tmemset(ip_hdr, 0, sizeof(*ip_hdr));\n+\t\t\tip_hdr->version_ihl\t= RTE_IPV4_VHL_DEF;\n+\t\t\tip_hdr->type_of_service\t= 0;\n+\t\t\tip_hdr->fragment_offset\t= 0;\n+\t\t\tip_hdr->time_to_live\t= IP_DEFTTL;\n+\t\t\tip_hdr->next_proto_id\t= IPPROTO_UDP;\n+\t\t\tip_hdr->packet_id\t= 0;\n+\t\t\tip_hdr->src_addr\t= rte_cpu_to_be_32(cfg_ip_src);\n+\t\t\tip_hdr->dst_addr\t= rte_cpu_to_be_32(cfg_ip_dst +\n+\t\t\t\t\t\t\t\tnext_flow);\n+\t\t\tip_hdr->total_length\t= RTE_CPU_TO_BE_16(pkt_size -\n+\t\t\t\t\t\t\t\tsizeof(*eth_hdr));\n+\t\t\tip_hdr->hdr_checksum\t= ip_sum((unaligned_uint16_t *)ip_hdr,\n+\t\t\t\t\t\t\tsizeof(*ip_hdr));\n+\n+\t\t\t/* Initialize UDP header. */\n+\t\t\tudp_hdr = (struct rte_udp_hdr *)(ip_hdr + 1);\n+\t\t\tudp_hdr->src_port\t= rte_cpu_to_be_16(cfg_udp_src);\n+\t\t\tudp_hdr->dst_port\t= rte_cpu_to_be_16(cfg_udp_dst);\n+\t\t\tudp_hdr->dgram_cksum\t= 0; /* No UDP checksum. */\n+\t\t\tudp_hdr->dgram_len\t= RTE_CPU_TO_BE_16(pkt_size -\n+\t\t\t\t\t\t\t\tsizeof(*eth_hdr) -\n+\t\t\t\t\t\t\t\tsizeof(*ip_hdr));\n+\t\t\tpkt->nb_segs\t\t= 1;\n+\t\t\tpkt->pkt_len\t\t= pkt_size;\n+\t\t\tpkt->ol_flags\t\t&= EXT_ATTACHED_MBUF;\n+\t\t\tpkt->ol_flags\t\t|= ol_flags;\n+\t\t\tpkt->vlan_tci\t\t= vlan_tci;\n+\t\t\tpkt->vlan_tci_outer\t= vlan_tci_outer;\n+\t\t\tpkt->l2_len\t\t= sizeof(struct rte_ether_hdr);\n+\t\t\tpkt->l3_len\t\t= sizeof(struct rte_ipv4_hdr);\n+\t\t} else {\n+\t\t\tnb_clones--;\n+\t\t}\n+\t\tpkts_burst[nb_pkt] = pkt;\n \n \t\tnext_flow = (next_flow + 1) % cfg_n_flows;\n \t}\ndiff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c\nindex 1ead59579..a2863bf8d 100644\n--- a/app/test-pmd/parameters.c\n+++ b/app/test-pmd/parameters.c\n@@ -161,6 +161,7 @@ usage(char* progname)\n \tprintf(\"  --hairpinq=N: set the number of hairpin queues per port to \"\n \t       \"N.\\n\");\n \tprintf(\"  --burst=N: set the number of packets per burst to N.\\n\");\n+\tprintf(\"  --clones=N: set the number of single packet clones to send. Should be less than burst value.\\n\");\n \tprintf(\"  --mbcache=N: set the cache of mbuf memory pool to N.\\n\");\n \tprintf(\"  --rxpt=N: set prefetch threshold register of RX rings to N.\\n\");\n \tprintf(\"  --rxht=N: set the host threshold register of RX rings to N.\\n\");\n@@ -645,6 +646,7 @@ launch_args_parse(int argc, char** argv)\n \t\t{ \"txd\",\t\t\t1, 0, 0 },\n \t\t{ \"hairpinq\",\t\t\t1, 0, 0 },\n \t\t{ \"burst\",\t\t\t1, 0, 0 },\n+\t\t{ \"clones\",\t\t\t1, 0, 0 },\n \t\t{ \"mbcache\",\t\t\t1, 0, 0 },\n \t\t{ \"txpt\",\t\t\t1, 0, 0 },\n \t\t{ \"txht\",\t\t\t1, 0, 0 },\n@@ -1151,6 +1153,16 @@ launch_args_parse(int argc, char** argv)\n \t\t\t\telse\n \t\t\t\t\tnb_pkt_per_burst = (uint16_t) n;\n \t\t\t}\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"clones\")) {\n+\t\t\t\tn = atoi(optarg);\n+\t\t\t\tif ((n >= 0) &&\n+\t\t\t\t    (n <= nb_pkt_per_burst))\n+\t\t\t\t\tnb_pkt_clones = (uint16_t) n;\n+\t\t\t\telse\n+\t\t\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\t \"clones must be >= 0 and <= %d (burst)\\n\",\n+\t\t\t\t\t\t nb_pkt_per_burst);\n+\t\t\t}\n \t\t\tif (!strcmp(lgopts[opt_idx].name, \"mbcache\")) {\n \t\t\t\tn = atoi(optarg);\n \t\t\t\tif ((n >= 0) &&\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex fe6450cc0..18b4b63d1 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -228,6 +228,7 @@ uint32_t tx_pkt_times_intra;\n /**< Timings for send scheduling in TXONLY mode, time between packets. */\n \n uint16_t nb_pkt_per_burst = DEF_PKT_BURST; /**< Number of packets per burst. */\n+uint16_t nb_pkt_clones; /**< Number of tx packet clones to send. */\n uint16_t mb_mempool_cache = DEF_MBUF_CACHE; /**< Size of mbuf mempool cache. */\n \n /* current configuration is in DCB or not,0 means it is not in DCB mode */\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex f139fe7a0..7337b5b94 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -431,6 +431,7 @@ extern enum tx_pkt_split tx_pkt_split;\n extern uint8_t txonly_multi_flow;\n \n extern uint16_t nb_pkt_per_burst;\n+extern uint16_t nb_pkt_clones;\n extern uint16_t mb_mempool_cache;\n extern int8_t rx_pthresh;\n extern int8_t rx_hthresh;\ndiff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst\nindex e2539f693..42c2efb1f 100644\n--- a/doc/guides/testpmd_app_ug/run_app.rst\n+++ b/doc/guides/testpmd_app_ug/run_app.rst\n@@ -296,6 +296,13 @@ The command line options are:\n     If set to 0, driver default is used if defined. Else, if driver\n     default is not defined, default of 32 is used.\n \n+*   ``--clones=N``\n+\n+    Set the number of each packet clones to be sent in `flowgen` mode.\n+    Sending clones reduces host CPU load on creating packets and may help\n+    in testing extreme speeds or maxing out tx packet performance.\n+    N should be not zero, but less than 'burst' parameter.\n+\n *   ``--mbcache=N``\n \n     Set the cache of mbuf memory pools to N, where 0 <= N <= 512.\n",
    "prefixes": [
        "RFC"
    ]
}