diff mbox

Patch to test multi-queue support on ODP-DPDK without Ixia

Message ID 1408977894-18407-1-git-send-email-venkatesh.vivekanandan@linaro.org
State New
Headers show

Commit Message

Venkatesh Vivekanandan Aug. 25, 2014, 2:44 p.m. UTC
From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>

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 <venkatesh.vivekanandan@linaro.org>
---
 example/generator/odp_generator.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Venkatesh Vivekanandan Aug. 26, 2014, 5:52 a.m. UTC | #1
Maxim,

Need not apply this patch to upstream. It was sent, so that someone else
can validate the multi-queue support in ODP-DPDK.

Thanks,
Venky


On 25 August 2014 20:14, <venkatesh.vivekanandan@linaro.org> wrote:

> From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
>
> 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 <venkatesh.vivekanandan@linaro.org>
> ---
>  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
>
>
Maxim Uvarov Aug. 26, 2014, 10:19 a.m. UTC | #2
On 08/26/2014 09:52 AM, Venkatesh Vivekanandan wrote:
> Maxim,
>
> Need not apply this patch to upstream. It was sent, so that someone 
> else can validate the multi-queue support in ODP-DPDK.
>
> Thanks,
> Venky

Venky I'm fine with that patch. Do we need to pass 12 to command line 
argument? 12 is number of cpus and number of dpdk threads, what will be 
if number of cpus will change? Might be set up this to 128 to blast 128 
different ips?

Maxim.

>
>
> On 25 August 2014 20:14, <venkatesh.vivekanandan@linaro.org 
> <mailto:venkatesh.vivekanandan@linaro.org>> wrote:
>
>     From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org
>     <mailto:venkatesh.vivekanandan@linaro.org>>
>
>     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
>     <venkatesh.vivekanandan@linaro.org
>     <mailto:venkatesh.vivekanandan@linaro.org>>
>     ---
>      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
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Venkatesh Vivekanandan Aug. 26, 2014, 11:01 a.m. UTC | #3
On 26 August 2014 15:49, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 08/26/2014 09:52 AM, Venkatesh Vivekanandan wrote:
>
>> Maxim,
>>
>> Need not apply this patch to upstream. It was sent, so that someone else
>> can validate the multi-queue support in ODP-DPDK.
>>
>> Thanks,
>> Venky
>>
>
> Venky I'm fine with that patch. Do we need to pass 12 to command line
> argument? 12 is number of cpus and number of dpdk threads, what will be if
> number of cpus will change? Might be set


Currently we can't pass from command line, one has to make the change in
the code. Since this is just a sample(simple :-) ) patch, sent it with
hard-coded values and not sure of the behavior with 128. I tested it on 4
ports(2 in pktgen and 2 in odp-dpdk) and 16 cpu machine, so 8 cpu's and 8
rings per odp-dpdk interface. From what I have seen, it varies based on
dstip and it requires 12 different ip address to exercise all 8 cpu's of
one interface in my test setup. It is good to use 128.

up this to 128 to blast 128 different ips?
>
> Maxim.
>
>
>>
>> On 25 August 2014 20:14, <venkatesh.vivekanandan@linaro.org <mailto:
>> venkatesh.vivekanandan@linaro.org>> wrote:
>>
>>     From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org
>>     <mailto:venkatesh.vivekanandan@linaro.org>>
>>
>>
>>     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
>>     <venkatesh.vivekanandan@linaro.org
>>     <mailto:venkatesh.vivekanandan@linaro.org>>
>>
>>     ---
>>      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
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Mike Holmes Aug. 26, 2014, 12:24 p.m. UTC | #4
We really want the test to be part of CI, to that end do we have to add the
arguments so that this can be applied and worked into a CI test case ?
If we don't create this test case with odp_generator how will we add the
test case ?

MIke


On 26 August 2014 07:01, Venkatesh Vivekanandan <
venkatesh.vivekanandan@linaro.org> wrote:

>
>
>
> On 26 August 2014 15:49, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>
>> On 08/26/2014 09:52 AM, Venkatesh Vivekanandan wrote:
>>
>>> Maxim,
>>>
>>> Need not apply this patch to upstream. It was sent, so that someone else
>>> can validate the multi-queue support in ODP-DPDK.
>>>
>>> Thanks,
>>> Venky
>>>
>>
>> Venky I'm fine with that patch. Do we need to pass 12 to command line
>> argument? 12 is number of cpus and number of dpdk threads, what will be if
>> number of cpus will change? Might be set
>
>
> Currently we can't pass from command line, one has to make the change in
> the code. Since this is just a sample(simple :-) ) patch, sent it with
> hard-coded values and not sure of the behavior with 128. I tested it on 4
> ports(2 in pktgen and 2 in odp-dpdk) and 16 cpu machine, so 8 cpu's and 8
> rings per odp-dpdk interface. From what I have seen, it varies based on
> dstip and it requires 12 different ip address to exercise all 8 cpu's of
> one interface in my test setup. It is good to use 128.
>
> up this to 128 to blast 128 different ips?
>>
>> Maxim.
>>
>>
>>>
>>> On 25 August 2014 20:14, <venkatesh.vivekanandan@linaro.org <mailto:
>>> venkatesh.vivekanandan@linaro.org>> wrote:
>>>
>>>     From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org
>>>     <mailto:venkatesh.vivekanandan@linaro.org>>
>>>
>>>
>>>     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
>>>     <venkatesh.vivekanandan@linaro.org
>>>     <mailto:venkatesh.vivekanandan@linaro.org>>
>>>
>>>     ---
>>>      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
>>> lng-odp@lists.linaro.org
>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>>
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
Stuart Haslam Aug. 26, 2014, 1:51 p.m. UTC | #5
On Mon, Aug 25, 2014 at 03:44:53PM +0100, venkatesh.vivekanandan@linaro.org wrote:
> From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
> 
> 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 <venkatesh.vivekanandan@linaro.org>
> ---
>  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?) and args->appl.dstip is global, so for every
pack_udp_pkt call it gets incremented by 1..
Maxim Uvarov Aug. 26, 2014, 2:08 p.m. UTC | #6
On 08/26/2014 05:51 PM, Stuart Haslam wrote:
> On Mon, Aug 25, 2014 at 03:44:53PM +0100, venkatesh.vivekanandan@linaro.org wrote:
>> From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
>>
>> 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 <venkatesh.vivekanandan@linaro.org>
>> ---
>>   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.
>   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.
Stuart Haslam Aug. 26, 2014, 2:34 p.m. UTC | #7
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, venkatesh.vivekanandan@linaro.org wrote:
> >> From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
> >>
> >> 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 <venkatesh.vivekanandan@linaro.org>
> >> ---
> >>   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.

> >   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.
>
Maxim Uvarov Aug. 26, 2014, 2:35 p.m. UTC | #8
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, venkatesh.vivekanandan@linaro.org wrote:
>>>> From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
>>>>
>>>> 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 <venkatesh.vivekanandan@linaro.org>
>>>> ---
>>>>    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.
>>
Maxim Uvarov Aug. 26, 2014, 2:38 p.m. UTC | #9
On 08/26/2014 06:35 PM, Maxim Uvarov wrote:
> 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, 
>>>> venkatesh.vivekanandan@linaro.org wrote:
>>>>> From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
>>>>>
>>>>> 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 
>>>>> <venkatesh.vivekanandan@linaro.org>
>>>>> ---
>>>>>    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?

Ah, sorry loop in function above. Stuart, you are right here. That's 
need to be fixed.

Upper function has counters.seq, Venky you can relay on it.

Maxim.
>
>
>>>>    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.
>>>
>
Venkatesh Vivekanandan Aug. 27, 2014, 11:42 a.m. UTC | #10
On 26 August 2014 20:08, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 08/26/2014 06:35 PM, Maxim Uvarov wrote:
>
>> 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,
>>>>> venkatesh.vivekanandan@linaro.org wrote:
>>>>>
>>>>>> From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
>>>>>>
>>>>>> 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 <venkatesh.vivekanandan@
>>>>>> linaro.org>
>>>>>> ---
>>>>>>    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?
>>
>
> Ah, sorry loop in function above. Stuart, you are right here. That's need
> to be fixed.
>
> Upper function has counters.seq, Venky you can relay on it.


As we discussed in the call, please drop this patch. The intention of this
set of modification was to help someone test multi-queue support. We
definitely need a more cleaner patch in odp_generator to create different
dstip's.



>
>
> Maxim.
>
>
>>
>>     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
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
diff mbox

Patch

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;