get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 949,
    "url": "http://patches.dpdk.org/api/patches/949/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1414130282-17981-2-git-send-email-cunming.liang@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": "<1414130282-17981-2-git-send-email-cunming.liang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1414130282-17981-2-git-send-email-cunming.liang@intel.com",
    "date": "2014-10-24T05:58:00",
    "name": "[dpdk-dev,v5,1/3] app/test: allow to create packets in different sizes",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4d70669a4ac1f466944c99df63bbdf4780c9c5a9",
    "submitter": {
        "id": 46,
        "url": "http://patches.dpdk.org/api/people/46/?format=api",
        "name": "Cunming Liang",
        "email": "cunming.liang@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1414130282-17981-2-git-send-email-cunming.liang@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/949/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/949/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id A07507EA8;\n\tFri, 24 Oct 2014 07:50:02 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id DC7D77EA8\n\tfor <dev@dpdk.org>; Fri, 24 Oct 2014 07:49:49 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga102.fm.intel.com with ESMTP; 23 Oct 2014 22:58:16 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga002.fm.intel.com with ESMTP; 23 Oct 2014 22:58:15 -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 s9O5wDkQ023773;\n\tFri, 24 Oct 2014 13:58:13 +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 s9O5wB7I018027; Fri, 24 Oct 2014 13:58:13 +0800",
            "(from cliang18@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s9O5wAmA018023; \n\tFri, 24 Oct 2014 13:58:10 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,778,1406617200\"; d=\"scan'208\";a=\"619629851\"",
        "From": "Cunming Liang <cunming.liang@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 24 Oct 2014 13:58:00 +0800",
        "Message-Id": "<1414130282-17981-2-git-send-email-cunming.liang@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1414130282-17981-1-git-send-email-cunming.liang@intel.com>",
        "References": "<1414129180-17669-1-git-send-email-cunming.liang@intel.com>\n\t<1414130282-17981-1-git-send-email-cunming.liang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5 1/3] app/test: allow to create packets in\n\tdifferent sizes",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "adding support to allow packet burst generator to create packets in 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 3 files changed, 43 insertions(+), 33 deletions(-)",
    "diff": "diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c\nindex 9e747a4..017139b 100644\n--- a/app/test/packet_burst_generator.c\n+++ b/app/test/packet_burst_generator.c\n@@ -191,20 +191,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 64\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_128,\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@@ -221,9 +213,9 @@ nomore_mbuf:\n \t\t\tbreak;\n \t\t}\n \n-\t\tpkt->data_len = tx_pkt_seg_lengths[0];\n+\t\tpkt->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->next = rte_pktmbuf_alloc(mp);\n \t\t\tif (pkt_seg->next == NULL) {\n \t\t\t\tpkt->nb_segs = i;\n@@ -231,7 +223,7 @@ nomore_mbuf:\n \t\t\t\tgoto nomore_mbuf;\n \t\t\t}\n \t\t\tpkt_seg = pkt_seg->next;\n-\t\t\tpkt_seg->data_len = tx_pkt_seg_lengths[i];\n+\t\t\tpkt_seg->data_len = pkt_len;\n \t\t}\n \t\tpkt_seg->next = NULL; /* Last segment of packet. */\n \n@@ -259,8 +251,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->nb_segs = tx_pkt_nb_segs;\n-\t\tpkt->pkt_len = tx_pkt_length;\n+\t\tpkt->nb_segs = nb_pkt_segs;\n+\t\tpkt->pkt_len = pkt_len;\n \t\tpkt->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 214d2a2..d407e4f 100644\n--- a/app/test/test_link_bonding.c\n+++ b/app/test/test_link_bonding.c\n@@ -1192,9 +1192,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@@ -1781,9 +1784,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@@ -2435,8 +2441,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@@ -2444,8 +2452,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@@ -3263,9 +3273,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 \n",
    "prefixes": [
        "dpdk-dev",
        "v5",
        "1/3"
    ]
}