From: Venkatesh Vivekanandan <[email protected]> setup:
- connect two ixgbe/igb cards to x86 box which has atleast 4 cpus. - Lets say we have eth0 & eth1 in one card and eth2 & eth3 in other card - eth0 and eth2 are connected back to back using cross cable(1g) or fibre(10g) - Similarly connect eth1 and eth3 test: - say eth2 and eth3 are given to dpdk on which odp-dpdk l2fwd app is running. cmd is ./example/l2fwd/odp_l2fwd -i 0,1 -m 0 - ensure eth0 and eth1 are brought up and put in promiscuous mode. - start odp_generator in rx mode in eth1. cmd is ./example/generator/odp_generator -I eth1 -m r - start odp_generator in tx mode in eth0. cmd is ./example/generator/odp_generator -I eth0 --srcmac a0:36:9f:13:89:08 --dstmac a0:36:9f:13:89:c8 -m u --dstip 201.0.0.0 - replace srcmac(eth0) and dstmac(eth2) with actual mac addresses on the port. - choose suitable dstip, so that packets are distributed to different cpus on the machine. Signed-off-by: Venkatesh Vivekanandan <[email protected]> --- example/generator/odp_generator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index b10372e..d202a8a 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -171,7 +171,7 @@ static int scan_mac(char *in, odp_ethaddr_t *des) static void pack_udp_pkt(odp_buffer_t obuf) { char *buf; - int max; + int max, i = 0; odp_packet_t pkt; odp_ethhdr_t *eth; odp_ipv4hdr_t *ip; @@ -195,6 +195,8 @@ static void pack_udp_pkt(odp_buffer_t obuf) /* ip */ odp_packet_set_l3_offset(pkt, ODP_ETHHDR_LEN); ip = (odp_ipv4hdr_t *)(buf + ODP_ETHHDR_LEN); + i = ((i+1) % 12); + args->appl.dstip = args->appl.dstip + i; ip->dst_addr = odp_cpu_to_be_32(args->appl.dstip); ip->src_addr = odp_cpu_to_be_32(args->appl.srcip); ip->ver_ihl = ODP_IPV4 << 4 | ODP_IPV4HDR_IHL_MIN; -- 1.8.1.2 _______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
