From: Declan Doherty <declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dev-VfR2kkLFssw@public.gmane.org
Subject: [PATCH v2 5/6] test app: adding support for generating variable sized packets
Date: Mon, 1 Sep 2014 09:31:28 +0100 [thread overview]
Message-ID: <1409560289-29558-6-git-send-email-declan.doherty@intel.com> (raw)
In-Reply-To: <1408456313-28812-1-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Declan Doherty <declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
app/test/packet_burst_generator.c | 22 +++++++---------------
app/test/packet_burst_generator.h | 6 +++++-
app/test/test_link_bonding.c | 14 +++++++++-----
3 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index 5d539f1..9ce6472 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -190,20 +190,12 @@ initialize_ipv4_header(struct ipv4_hdr *ip_hdr, uint32_t src_addr,
*/
#define RTE_MAX_SEGS_PER_PKT 255 /**< pkt.nb_segs is a 8-bit unsigned char. */
-#define TXONLY_DEF_PACKET_LEN 64
-#define TXONLY_DEF_PACKET_LEN_128 128
-
-uint16_t tx_pkt_length = TXONLY_DEF_PACKET_LEN;
-uint16_t tx_pkt_seg_lengths[RTE_MAX_SEGS_PER_PKT] = {
- TXONLY_DEF_PACKET_LEN_128,
-};
-
-uint8_t tx_pkt_nb_segs = 1;
int
generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,
struct ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,
- uint8_t ipv4, struct udp_hdr *udp_hdr, int nb_pkt_per_burst)
+ uint8_t ipv4, struct udp_hdr *udp_hdr, int nb_pkt_per_burst,
+ uint8_t pkt_len, uint8_t nb_pkt_segs)
{
int i, nb_pkt = 0;
size_t eth_hdr_size;
@@ -220,9 +212,9 @@ nomore_mbuf:
break;
}
- pkt->pkt.data_len = tx_pkt_seg_lengths[0];
+ pkt->pkt.data_len = pkt_len;
pkt_seg = pkt;
- for (i = 1; i < tx_pkt_nb_segs; i++) {
+ for (i = 1; i < nb_pkt_segs; i++) {
pkt_seg->pkt.next = rte_pktmbuf_alloc(mp);
if (pkt_seg->pkt.next == NULL) {
pkt->pkt.nb_segs = i;
@@ -230,7 +222,7 @@ nomore_mbuf:
goto nomore_mbuf;
}
pkt_seg = pkt_seg->pkt.next;
- pkt_seg->pkt.data_len = tx_pkt_seg_lengths[i];
+ pkt_seg->pkt.data_len = pkt_len;
}
pkt_seg->pkt.next = NULL; /* Last segment of packet. */
@@ -258,8 +250,8 @@ nomore_mbuf:
* Complete first mbuf of packet and append it to the
* burst of packets to be transmitted.
*/
- pkt->pkt.nb_segs = tx_pkt_nb_segs;
- pkt->pkt.pkt_len = tx_pkt_length;
+ pkt->pkt.nb_segs = nb_pkt_segs;
+ pkt->pkt.pkt_len = pkt_len;
pkt->pkt.vlan_macip.f.l2_len = eth_hdr_size;
if (ipv4) {
diff --git a/app/test/packet_burst_generator.h b/app/test/packet_burst_generator.h
index 5b3cd6c..f86589e 100644
--- a/app/test/packet_burst_generator.h
+++ b/app/test/packet_burst_generator.h
@@ -47,6 +47,9 @@ extern "C" {
#define IPV4_ADDR(a, b, c, d)(((a & 0xff) << 24) | ((b & 0xff) << 16) | \
((c & 0xff) << 8) | (d & 0xff))
+#define PACKET_BURST_GEN_PKT_LEN 60
+#define PACKET_BURST_GEN_PKT_LEN_128 128
+
void
initialize_eth_header(struct ether_hdr *eth_hdr, struct ether_addr *src_mac,
@@ -68,7 +71,8 @@ initialize_ipv4_header(struct ipv4_hdr *ip_hdr, uint32_t src_addr,
int
generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,
struct ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,
- uint8_t ipv4, struct udp_hdr *udp_hdr, int nb_pkt_per_burst);
+ uint8_t ipv4, struct udp_hdr *udp_hdr, int nb_pkt_per_burst,
+ uint8_t pkt_len, uint8_t nb_pkt_segs);
#ifdef __cplusplus
}
diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index c5aaa80..1c06e2d 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -1338,7 +1338,8 @@ generate_test_burst(struct rte_mbuf **pkts_burst, uint16_t burst_size,
/* Generate burst of packets to transmit */
generated_burst_size = generate_packet_burst(test_params->mbuf_pool,
pkts_burst, test_params->pkt_eth_hdr, vlan, ip_hdr, ipv4,
- test_params->pkt_udp_hdr, burst_size);
+ test_params->pkt_udp_hdr, burst_size, PACKET_BURST_GEN_PKT_LEN_128,
+ 1);
if (generated_burst_size != burst_size) {
printf("Failed to generate packet burst");
return -1;
@@ -2056,7 +2057,7 @@ test_activebackup_tx_burst(void)
/* Generate a burst of packets to transmit */
generated_burst_size = generate_packet_burst(test_params->mbuf_pool,
pkts_burst, test_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr,
- 1, test_params->pkt_udp_hdr, burst_size);
+ 1, test_params->pkt_udp_hdr, burst_size, PACKET_BURST_GEN_PKT_LEN, 1);
if (generated_burst_size != burst_size)
return -1;
@@ -2709,7 +2710,8 @@ test_balance_l2_tx_burst(void)
/* Generate a burst 1 of packets to transmit */
if (generate_packet_burst(test_params->mbuf_pool, &pkts_burst[0][0],
test_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr, 1,
- test_params->pkt_udp_hdr, burst_size[0]) != burst_size[0])
+ test_params->pkt_udp_hdr, burst_size[0],
+ PACKET_BURST_GEN_PKT_LEN, 1) != burst_size[0])
return -1;
initialize_eth_header(test_params->pkt_eth_hdr,
@@ -2718,7 +2720,8 @@ test_balance_l2_tx_burst(void)
/* Generate a burst 2 of packets to transmit */
if (generate_packet_burst(test_params->mbuf_pool, &pkts_burst[1][0],
test_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr, 1,
- test_params->pkt_udp_hdr, burst_size[1]) != burst_size[1])
+ test_params->pkt_udp_hdr, burst_size[1],
+ PACKET_BURST_GEN_PKT_LEN, 1) != burst_size[1])
return -1;
/* Send burst 1 on bonded port */
@@ -3672,7 +3675,8 @@ test_broadcast_tx_burst(void)
/* Generate a burst of packets to transmit */
generated_burst_size = generate_packet_burst(test_params->mbuf_pool,
pkts_burst, test_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr,
- 1, test_params->pkt_udp_hdr, burst_size);
+ 1, test_params->pkt_udp_hdr, burst_size, PACKET_BURST_GEN_PKT_LEN,
+ 1);
if (generated_burst_size != burst_size)
return -1;
--
1.7.0.7
next prev parent reply other threads:[~2014-09-01 8:31 UTC|newest]
Thread overview: 91+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-19 13:51 [PATCH 0/6] link bonding Declan Doherty
[not found] ` <1408456313-28812-1-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-08-19 13:51 ` [PATCH 1/6] bond: link status interrupt support Declan Doherty
[not found] ` <1408456313-28812-2-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-08-20 20:24 ` Sanford, Robert
2014-08-19 13:51 ` [PATCH 2/6] bond: removing switch statement from rx burst method Declan Doherty
[not found] ` <1408456313-28812-3-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-08-20 20:25 ` Sanford, Robert
2014-08-19 13:51 ` [PATCH 3/6] bond: fix naming inconsistency in tx_burst_round_robin Declan Doherty
[not found] ` <1408456313-28812-4-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-08-20 20:25 ` Sanford, Robert
2014-08-19 13:51 ` [PATCH 4/6] bond: free mbufs if transmission fails in bonding tx_burst functions Declan Doherty
2014-08-19 13:51 ` [PATCH 5/6] test app: adding support for generating variable sized packets Declan Doherty
2014-08-19 13:51 ` [PATCH 6/6] testpmd: adding parameter to reconfig method to set socket_id when adding new port to portlist Declan Doherty
2014-08-22 7:41 ` [PATCH 0/6] link bonding Jiajia, SunX
2014-09-01 8:31 ` [PATCH v2 " Declan Doherty
[not found] ` <1409560289-29558-1-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-09-02 13:31 ` De Lara Guarch, Pablo
2014-09-02 18:15 ` Stephen Hemminger
2014-09-01 8:31 ` [PATCH v2 1/6] bond: link status interrupt support Declan Doherty
2014-09-01 8:31 ` [PATCH v2 2/6] bond: removing switch statement from rx burst method Declan Doherty
2014-09-01 8:31 ` [PATCH v2 3/6] bond: fix naming inconsistency in tx_burst_round_robin Declan Doherty
2014-09-01 8:31 ` [PATCH v2 4/6] bond: free mbufs if transmission fails in bonding tx_burst functions Declan Doherty
[not found] ` <1409560289-29558-5-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-09-02 9:22 ` Doherty, Declan
[not found] ` <345C63BAECC1AD42A2EC8C63AFFC3ADC2737656B-kPTMFJFq+rF9qrmMLTLiibfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-02 9:31 ` Thomas Monjalon
2014-09-23 13:18 ` [PATCH v3 0/5] link bonding Declan Doherty
[not found] ` <1411478290-28807-1-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-09-23 13:18 ` [PATCH v3 1/5] bond: free mbufs if transmission fails in bonding tx_burst functions Declan Doherty
2014-09-23 13:18 ` [PATCH v3 2/5] test app: adding support for generating variable sized packet Declan Doherty
2014-09-23 13:18 ` [PATCH v3 3/5] testpmd: adding parameter to reconfig method to set socket_id when adding new port to portlist Declan Doherty
2014-09-23 13:18 ` [PATCH v3 4/5] bond: lsc polling support Declan Doherty
[not found] ` <1411478290-28807-5-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-09-24 13:16 ` Ananyev, Konstantin
2014-09-23 13:18 ` [PATCH v3 5/5] bond: unit test test macro refactor Declan Doherty
2014-09-01 8:31 ` Declan Doherty [this message]
2014-09-01 8:31 ` [PATCH v2 6/6] testpmd: adding parameter to reconfig method to set socket_id when adding new port to portlist Declan Doherty
2014-09-30 9:57 ` [PATCH v4 0/8] link bonding Declan Doherty
[not found] ` <1412071079-7355-1-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-09-30 9:57 ` [PATCH v4 1/8] bond: link status interrupt support Declan Doherty
2014-09-30 9:57 ` [PATCH v4 2/8] bond: removing switch statement from rx burst method Declan Doherty
2014-09-30 9:57 ` [PATCH v4 3/8] bond: fix naming inconsistency in tx_burst_round_robin Declan Doherty
2014-09-30 9:57 ` [PATCH v4 4/8] bond: free mbufs if transmission fails in bonding tx_burst functions Declan Doherty
[not found] ` <1412071079-7355-5-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-10-13 15:29 ` De Lara Guarch, Pablo
2014-09-30 9:57 ` [PATCH v4 5/8] test app: adding support for generating variable sized packet bursts Declan Doherty
[not found] ` <1412071079-7355-6-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-10-24 3:22 ` Liang, Cunming
2014-09-30 9:57 ` [PATCH v4 6/8] testpmd: adding parameter to reconfig method to set socket_id when adding new port to portlist Declan Doherty
2014-09-30 9:57 ` [PATCH v4 7/8] bond: lsc polling support Declan Doherty
2014-09-30 9:57 ` [PATCH v4 8/8] bond: unit test test macro refactor Declan Doherty
2014-10-08 8:49 ` [PATCH v4 0/8] link bonding Jiajia, SunX
2014-10-09 19:20 ` De Lara Guarch, Pablo
2014-10-14 12:59 ` [PATCH v5 " Declan Doherty
[not found] ` <1413291597-27326-1-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-10-14 12:59 ` [PATCH v5 1/8] bond: link status interrupt support Declan Doherty
2014-10-14 12:59 ` [PATCH v5 2/8] bond: removing switch statement from rx burst method Declan Doherty
2014-10-14 12:59 ` [PATCH v5 3/8] bond: fix naming inconsistency in tx_burst_round_robin Declan Doherty
2014-10-14 12:59 ` [PATCH v5 4/8] bond: free mbufs if transmission fails in bonding tx_burst functions Declan Doherty
2014-10-14 12:59 ` [PATCH v5 5/8] test app: adding support for generating variable sized packet Declan Doherty
2014-10-14 12:59 ` [PATCH v5 6/8] testpmd: adding parameter to reconfig method to set socket_id when adding new port to portlist Declan Doherty
2014-10-14 12:59 ` [PATCH v5 7/8] bond: lsc polling support Declan Doherty
2014-10-14 12:59 ` [PATCH v5 8/8] bond: unit test test macro refactor Declan Doherty
2014-10-14 15:59 ` [PATCH v5 0/8] link bonding De Lara Guarch, Pablo
2014-11-05 3:10 ` Jiajia, SunX
2014-11-07 12:22 ` [PATCH v6 " Declan Doherty
[not found] ` <1415362978-6306-1-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-07 12:22 ` [PATCH v6 1/8] bond: link status interrupt support Declan Doherty
2014-11-07 12:22 ` [PATCH v6 2/8] bond: removing switch statement from rx burst method Declan Doherty
2014-11-07 12:22 ` [PATCH v6 3/8] bond: fix naming inconsistency in tx_burst_round_robin Declan Doherty
2014-11-07 12:22 ` [PATCH v6 4/8] bond: free mbufs if transmission fails in bonding tx_burst functions Declan Doherty
2014-11-07 12:22 ` [PATCH v6 5/8] test app: adding support for generating variable sized packet Declan Doherty
2014-11-07 12:22 ` [PATCH v6 6/8] testpmd: adding parameter to reconfig method to set socket_id when adding new port to portlist Declan Doherty
2014-11-07 12:22 ` [PATCH v6 7/8] bond: lsc polling support Declan Doherty
2014-11-07 12:22 ` [PATCH v6 8/8] bond: unit test test macro refactor Declan Doherty
2014-11-07 16:40 ` [PATCH v6 0/8] link bonding De Lara Guarch, Pablo
[not found] ` <E115CCD9D858EF4F90C690B0DCB4D89726834C36-kPTMFJFq+rEMvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-21 17:07 ` Doherty, Declan
[not found] ` <345C63BAECC1AD42A2EC8C63AFFC3ADC27422D1C-kPTMFJFq+rF9qrmMLTLiibfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-21 18:36 ` Thomas Monjalon
2014-11-23 13:40 ` Thomas Monjalon
2014-11-21 8:59 ` Jiajia, SunX
2014-11-24 12:27 ` [PATCH v7 0/7] " Declan Doherty
[not found] ` <1416832054-24086-1-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-24 12:27 ` [PATCH v7 1/7] bond: link status interrupt support Declan Doherty
2014-11-24 12:27 ` [PATCH v7 2/7] bond: removing switch statement from rx burst method Declan Doherty
2014-11-24 12:27 ` [PATCH v7 3/7] bond: fix naming inconsistency in tx_burst_round_robin Declan Doherty
2014-11-24 12:27 ` [PATCH v7 4/7] bond: free mbufs if transmission fails in bonding tx_burst functions Declan Doherty
2014-11-24 12:27 ` [PATCH v7 5/7] testpmd: adding parameter to reconfig method to set socket_id when adding new port to portlist Declan Doherty
2014-11-24 12:27 ` [PATCH v7 6/7] bond: lsc polling support Declan Doherty
2014-11-24 12:27 ` [PATCH v7 7/7] bond: unit test test macro refactor Declan Doherty
2014-11-24 15:35 ` [PATCH v7 0/7] link bonding Thomas Monjalon
2014-11-24 16:24 ` Doherty, Declan
[not found] ` <345C63BAECC1AD42A2EC8C63AFFC3ADC274244EC-kPTMFJFq+rF9qrmMLTLiibfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-24 17:53 ` Thomas Monjalon
2014-11-24 16:33 ` [PATCH v8 " Declan Doherty
[not found] ` <1416846822-26897-1-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-24 16:33 ` [PATCH v8 1/7] bond: link status interrupt support Declan Doherty
2014-11-24 16:33 ` [PATCH v8 2/7] bond: removing switch statement from rx burst method Declan Doherty
2014-11-24 16:33 ` [PATCH v8 3/7] bond: fix naming inconsistency in tx_burst_round_robin Declan Doherty
2014-11-24 16:33 ` [PATCH v8 4/7] bond: free mbufs if transmission fails in bonding tx_burst functions Declan Doherty
2014-11-24 16:33 ` [PATCH v8 5/7] testpmd: adding parameter to reconfig method to set socket_id when adding new port to portlist Declan Doherty
2014-11-24 16:33 ` [PATCH v8 6/7] bond: lsc polling support Declan Doherty
2014-11-24 16:33 ` [PATCH v8 7/7] bond: unit test test macro refactor Declan Doherty
2014-11-24 18:32 ` [PATCH v8 0/7] link bonding Thomas Monjalon
2014-11-24 18:51 ` Thomas Monjalon
2014-11-24 20:54 ` Thomas Monjalon
2014-11-25 10:56 ` Jastrzebski, MichalX K
[not found] ` <60ABE07DBB3A454EB7FAD707B4BB1582138BC9F8-kPTMFJFq+rHjxeytcECX8bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-25 11:20 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1409560289-29558-6-git-send-email-declan.doherty@intel.com \
--to=declan.doherty-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=dev-VfR2kkLFssw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.