On 08/26/2014 06:34 PM, Stuart Haslam wrote:
On Tue, Aug 26, 2014 at 03:08:20PM +0100, Maxim Uvarov wrote:
On 08/26/2014 05:51 PM, Stuart Haslam wrote:
On Mon, Aug 25, 2014 at 03:44:53PM +0100, [email protected]
wrote:
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;
The patch description didn't help me understand what the patch was
intended to achieve, but it looks broken. i will always be 1 (was it
supposed to be static?)
that is not true.
Which part?.. it still looks broken to me.
i = ((i+1) % 12);
increments i, isn't it?
and args->appl.dstip is global, so for every
pack_udp_pkt call it gets incremented by 1..
and that is good comment, modify global value is not good thing.
Maxim.
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp