Show a patch.

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

{
    "id": 205,
    "url": "https://patches.dpdk.org/api/patches/205/",
    "web_url": "https://patches.dpdk.org/patch/205/",
    "project": {
        "id": 1,
        "url": "https://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"
    },
    "msgid": "<1408947174-11323-6-git-send-email-cunming.liang@intel.com>",
    "date": "2014-08-25T06:12:54",
    "name": "[dpdk-dev,5/5] app/test: allow to create packets in different sizes",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ff39b724cf6c45dc87f3b14a14eeebf17207f6c1",
    "submitter": {
        "id": 46,
        "url": "https://patches.dpdk.org/api/people/46/",
        "name": "Cunming Liang",
        "email": "cunming.liang@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/patch/205/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/205/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/205/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<cliang18@shecgisg004.sh.intel.com>",
        "References": "<1408947174-11323-1-git-send-email-cunming.liang@intel.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": "E=Sophos;i=\"4.97,862,1389772800\"; d=\"scan'208\";a=\"376517155\"",
        "From": "Cunming Liang <cunming.liang@intel.com>",
        "X-List-Received-Date": "Mon, 25 Aug 2014 06:09:54 -0000",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1408947174-11323-6-git-send-email-cunming.liang@intel.com>",
        "Received": [
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 0D1D0B381\n\tfor <dev@dpdk.org>; Mon, 25 Aug 2014 08:09:53 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga101.fm.intel.com with ESMTP; 24 Aug 2014 23:13:47 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby FMSMGA003.fm.intel.com with ESMTP; 24 Aug 2014 23:09:42 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id s7P6Dipo012323;\n\tMon, 25 Aug 2014 14:13:44 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid s7P6De7J011410; Mon, 25 Aug 2014 14:13:42 +0800",
            "(from cliang18@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s7P6DeKT011406; \n\tMon, 25 Aug 2014 14:13:40 +0800"
        ],
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Precedence": "list",
        "Date": "Mon, 25 Aug 2014 14:12:54 +0800",
        "Subject": "[dpdk-dev] [PATCH 5/5] app/test: allow to create packets in\n\tdifferent sizes",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-ExtLoop1": "1",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "In-Reply-To": "<1408947174-11323-1-git-send-email-cunming.liang@intel.com>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "To": "dev@dpdk.org"
    },
    "content": "adding support to allow packet burst generator to create packets of differenct sizes\n\nSigned-off-by: Cunming Liang <cunming.liang@intel.com>\nAcked-by: Declan Doherty <declan.doherty@intel.com>\n---\n app/test/packet_burst_generator.c | 26 +++++++++-----------------\n app/test/packet_burst_generator.h | 11 ++++++++---\n app/test/test_link_bonding.c      | 39 ++++++++++++++++++++++++++-------------\n app/test/test_pmd_perf.c          |  3 ++-\n 4 files changed, 45 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c\nindex 943ea98..bf78362 100644\n--- a/app/test/packet_burst_generator.c\n+++ b/app/test/packet_burst_generator.c\n@@ -190,20 +190,12 @@ initialize_ipv4_header(struct ipv4_hdr *ip_hdr, uint32_t src_addr,\n  */\n #define RTE_MAX_SEGS_PER_PKT 255 /**< pkt.nb_segs is a 8-bit unsigned char. */\n \n-#define TXONLY_DEF_PACKET_LEN 60\n-#define TXONLY_DEF_PACKET_LEN_128 128\n-\n-uint16_t tx_pkt_length = TXONLY_DEF_PACKET_LEN;\n-uint16_t tx_pkt_seg_lengths[RTE_MAX_SEGS_PER_PKT] = {\n-\t\tTXONLY_DEF_PACKET_LEN,\n-};\n-\n-uint8_t  tx_pkt_nb_segs = 1;\n-\n int\n generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,\n-\t\tstruct ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,\n-\t\tuint8_t ipv4, struct udp_hdr *udp_hdr, int nb_pkt_per_burst)\n+\t\t      struct ether_hdr *eth_hdr, uint8_t vlan_enabled,\n+\t\t      void *ip_hdr, uint8_t ipv4, struct udp_hdr *udp_hdr,\n+\t\t      int nb_pkt_per_burst, uint8_t pkt_len,\n+\t\t      uint8_t nb_pkt_segs)\n {\n \tint i, nb_pkt = 0;\n \tsize_t eth_hdr_size;\n@@ -220,9 +212,9 @@ nomore_mbuf:\n \t\t\tbreak;\n \t\t}\n \n-\t\tpkt->pkt.data_len = tx_pkt_seg_lengths[0];\n+\t\tpkt->pkt.data_len = pkt_len;\n \t\tpkt_seg = pkt;\n-\t\tfor (i = 1; i < tx_pkt_nb_segs; i++) {\n+\t\tfor (i = 1; i < nb_pkt_segs; i++) {\n \t\t\tpkt_seg->pkt.next = rte_pktmbuf_alloc(mp);\n \t\t\tif (pkt_seg->pkt.next == NULL) {\n \t\t\t\tpkt->pkt.nb_segs = i;\n@@ -230,7 +222,7 @@ nomore_mbuf:\n \t\t\t\tgoto nomore_mbuf;\n \t\t\t}\n \t\t\tpkt_seg = pkt_seg->pkt.next;\n-\t\t\tpkt_seg->pkt.data_len = tx_pkt_seg_lengths[i];\n+\t\t\tpkt_seg->pkt.data_len = pkt_len;\n \t\t}\n \t\tpkt_seg->pkt.next = NULL; /* Last segment of packet. */\n \n@@ -258,8 +250,8 @@ nomore_mbuf:\n \t\t * Complete first mbuf of packet and append it to the\n \t\t * burst of packets to be transmitted.\n \t\t */\n-\t\tpkt->pkt.nb_segs = tx_pkt_nb_segs;\n-\t\tpkt->pkt.pkt_len = tx_pkt_length;\n+\t\tpkt->pkt.nb_segs = nb_pkt_segs;\n+\t\tpkt->pkt.pkt_len = pkt_len;\n \t\tpkt->pkt.vlan_macip.f.l2_len = eth_hdr_size;\n \n \t\tif (ipv4) {\ndiff --git a/app/test/packet_burst_generator.h b/app/test/packet_burst_generator.h\nindex 5b3cd6c..fe992ac 100644\n--- a/app/test/packet_burst_generator.h\n+++ b/app/test/packet_burst_generator.h\n@@ -47,10 +47,13 @@ extern \"C\" {\n #define IPV4_ADDR(a, b, c, d)(((a & 0xff) << 24) | ((b & 0xff) << 16) | \\\n \t\t((c & 0xff) << 8) | (d & 0xff))\n \n+#define PACKET_BURST_GEN_PKT_LEN         60\n+#define PACKET_BURST_GEN_PKT_LEN_128     128\n \n void\n initialize_eth_header(struct ether_hdr *eth_hdr, struct ether_addr *src_mac,\n-\t\tstruct ether_addr *dst_mac, uint8_t vlan_enabled, uint16_t van_id);\n+\t\t      struct ether_addr *dst_mac, uint8_t vlan_enabled,\n+\t\t      uint16_t van_id);\n \n uint16_t\n initialize_udp_header(struct udp_hdr *udp_hdr, uint16_t src_port,\n@@ -67,8 +70,10 @@ initialize_ipv4_header(struct ipv4_hdr *ip_hdr, uint32_t src_addr,\n \n int\n generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,\n-\t\tstruct ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,\n-\t\tuint8_t ipv4, struct udp_hdr *udp_hdr, int nb_pkt_per_burst);\n+\t\t      struct ether_hdr *eth_hdr, uint8_t vlan_enabled,\n+\t\t      void *ip_hdr, uint8_t ipv4, struct udp_hdr *udp_hdr,\n+\t\t      int nb_pkt_per_burst, uint8_t pkt_len,\n+\t\t      uint8_t nb_pkt_segs);\n \n #ifdef __cplusplus\n }\ndiff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c\nindex 5c1303e..758f1b1 100644\n--- a/app/test/test_link_bonding.c\n+++ b/app/test/test_link_bonding.c\n@@ -1189,9 +1189,12 @@ generate_test_burst(struct rte_mbuf **pkts_burst, uint16_t burst_size,\n \t}\n \n \t/* Generate burst of packets to transmit */\n-\tgenerated_burst_size = generate_packet_burst(test_params->mbuf_pool,\n-\t\t\tpkts_burst,\ttest_params->pkt_eth_hdr, vlan, ip_hdr, ipv4,\n-\t\t\ttest_params->pkt_udp_hdr, burst_size);\n+\tgenerated_burst_size =\n+\t\tgenerate_packet_burst(test_params->mbuf_pool,\n+\t\t\t\t      pkts_burst, test_params->pkt_eth_hdr,\n+\t\t\t\t      vlan, ip_hdr, ipv4,\n+\t\t\t\t      test_params->pkt_udp_hdr, burst_size,\n+\t\t\t\t      PACKET_BURST_GEN_PKT_LEN_128, 1);\n \tif (generated_burst_size != burst_size) {\n \t\tprintf(\"Failed to generate packet burst\");\n \t\treturn -1;\n@@ -1778,9 +1781,12 @@ test_activebackup_tx_burst(void)\n \t}\n \n \t/* Generate a burst of packets to transmit */\n-\tgenerated_burst_size = generate_packet_burst(test_params->mbuf_pool,\n-\t\t\tpkts_burst,\ttest_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr,\n-\t\t\t1, test_params->pkt_udp_hdr, burst_size);\n+\tgenerated_burst_size =\n+\t\tgenerate_packet_burst(test_params->mbuf_pool,\n+\t\t\t\t      pkts_burst, test_params->pkt_eth_hdr, 0,\n+\t\t\t\t      test_params->pkt_ipv4_hdr, 1,\n+\t\t\t\t      test_params->pkt_udp_hdr, burst_size,\n+\t\t\t\t      PACKET_BURST_GEN_PKT_LEN, 1);\n \tif (generated_burst_size != burst_size)\n \t\treturn -1;\n \n@@ -2432,8 +2438,10 @@ test_balance_l2_tx_burst(void)\n \n \t/* Generate a burst 1 of packets to transmit */\n \tif (generate_packet_burst(test_params->mbuf_pool, &pkts_burst[0][0],\n-\t\t\ttest_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr, 1,\n-\t\t\ttest_params->pkt_udp_hdr, burst_size[0]) != burst_size[0])\n+\t\t\t\t  test_params->pkt_eth_hdr, 0,\n+\t\t\t\t  test_params->pkt_ipv4_hdr, 1,\n+\t\t\t\t  test_params->pkt_udp_hdr, burst_size[0],\n+\t\t\t\t  PACKET_BURST_GEN_PKT_LEN, 1) != burst_size[0])\n \t\treturn -1;\n \n \tinitialize_eth_header(test_params->pkt_eth_hdr,\n@@ -2441,8 +2449,10 @@ test_balance_l2_tx_burst(void)\n \n \t/* Generate a burst 2 of packets to transmit */\n \tif (generate_packet_burst(test_params->mbuf_pool, &pkts_burst[1][0],\n-\t\t\ttest_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr, 1,\n-\t\t\ttest_params->pkt_udp_hdr, burst_size[1]) != burst_size[1])\n+\t\t\t\t  test_params->pkt_eth_hdr, 0,\n+\t\t\t\t  test_params->pkt_ipv4_hdr, 1,\n+\t\t\t\t  test_params->pkt_udp_hdr, burst_size[1],\n+\t\t\t\t  PACKET_BURST_GEN_PKT_LEN, 1) != burst_size[1])\n \t\treturn -1;\n \n \t/* Send burst 1 on bonded port */\n@@ -3259,9 +3269,12 @@ test_broadcast_tx_burst(void)\n \t}\n \n \t/* Generate a burst of packets to transmit */\n-\tgenerated_burst_size = generate_packet_burst(test_params->mbuf_pool,\n-\t\t\tpkts_burst,\ttest_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr,\n-\t\t\t1, test_params->pkt_udp_hdr, burst_size);\n+\tgenerated_burst_size =\n+\t\tgenerate_packet_burst(test_params->mbuf_pool,\n+\t\t\t\t      pkts_burst, test_params->pkt_eth_hdr, 0,\n+\t\t\t\t      test_params->pkt_ipv4_hdr, 1,\n+\t\t\t\t      test_params->pkt_udp_hdr, burst_size,\n+\t\t\t\t      PACKET_BURST_GEN_PKT_LEN, 1);\n \tif (generated_burst_size != burst_size)\n \t\treturn -1;\n \ndiff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c\nindex e11fa41..ea35b38 100644\n--- a/app/test/test_pmd_perf.c\n+++ b/app/test/test_pmd_perf.c\n@@ -253,7 +253,8 @@ init_traffic(struct rte_mempool *mp,\n \n \treturn generate_packet_burst(mp, pkts_burst, &pkt_eth_hdr,\n \t\t\t\t     0, &pkt_ipv4_hdr, 1,\n-\t\t\t\t     &pkt_udp_hdr, burst_size);\n+\t\t\t\t     &pkt_udp_hdr, burst_size,\n+\t\t\t\t     PACKET_BURST_GEN_PKT_LEN, 1);\n }\n \n static int\n",
    "prefixes": [
        "dpdk-dev",
        "5/5"
    ]
}