[dpdk-dev] [PATCH v4 0/4] enable mirror functionality in i40e driver

2015-06-10 Thread Jiajia, SunX
Tested-by: Jiajia Sunx 

- Tested Commit: 94ef2964148a4540db21034f5c3669ab81fbdc76
- OS: Fedora20 3.18.9
- GCC: gcc version 4.8.3 20140911
- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection 
[8086:10fb]
- NIC: Intel Corporation Ethernet Controller XL710 for 40GbE QSFP+ [8086:1583]
- Default x86_64-native-linuxapp-gcc configuration
- Prerequisites: vt-d enable in bios and IOMMU enable in kernel
- Total 8 cases, 8 passed, 0 failed

2VM prerequisites:

VF0 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 --  -i
VF0 testpmd-> set fwd rxonly
VF0 testpmd-> start

VF1 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 --  -i
VF1 testpmd-> set fwd mac
VF1 testpmd-> start

 - Case: Mirror Traffic between 2VMs with Pool mirroring
   Description: Verify the pool mirror rule
Set up common 2VM prerequisites.

Add one mirror rule that will mirror VM0 income traffic to VM1::

PF testpmd-> set port 0 mirror-rule 0 pool-mirror-up 0x1 
dst-pool 1 on

Send 10 packets to VM0 and verify the packets has been mirrored to VM1 
and
forwarded the packet.

After test need reset mirror rule::

PF testpmd-> reset port 0 mirror-rule 0


 - Case: Mirror Traffic between 2VMs with Uplink mirroring
   Description: Verify the uplink mirror rule
Set up common 2VM prerequisites.

Add one mirror rule that will mirror VM0 income traffic to VM1::

PF testpmd-> set port 0 mirror-rule 0 uplink-mirror dst-pool 1 
on

Send 10 packets to VM0 and verify the packets has been mirrored to VM1 
and
forwarded the packet.

After test need reset mirror rule::

PF testpmd-> reset port 0 mirror-rule 0

 - Case: Mirror Traffic between 2VMs with Downlink mirroring
   Description: Verify the downlink mirror rule
Run testpmd on VM0 and VM1 and start traffic forward on the VM hosts::

VF0 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 --  -i
VF1 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 --  -i

Add one mirror rule that will mirror VM0 outcome traffic to VM1::

  PF testpmd-> set port 0 mirror-rule 0 downlink-mirror dst-pool 1 on

Make sure VM1 in receive only mode, VM0 send 16 packets, and verify the 
VM0
packets has been mirrored to VM1::

VF1 testpmd-> set fwd rxonly
  VF1 testpmd-> start
  VF0 testpmd-> start tx_first 

Note: don't let VF1 fwd packets since downlink mirror will mirror back 
the
packets to received packets, which will be an infinite loop.

After test need reset mirror rule::

 PF testpmd-> reset port 0 mirror-rule 0  

 - Case: Mirror Traffic between VMs with Vlan mirroring
   Description: Verify the vlan mirror rule
Set up common 2VM prerequisites.

Add rx vlan-id 0 on VF0, add one mirror rule that will mirror VM0 income
traffic with specified vlan to VM1::
PF testpmd-> rx_vlan add 3 port 0 vf 0x1
PF testpmd-> set port 0 mirror-rule 0 vlan-mirror 3 dst-pool 1 
on

Send 10 packets with vlan-id0/vm0 MAC to VM0 and verify the packets has 
been
mirrored to VM1 and forwarded the packet.

After test need reset mirror rule::

PF testpmd-> reset port 0 mirror-rule 0

 - Case: Mirror Traffic between 2VMs with Vlan & Pool mirroring
   Description: Verify the misc mirror rules of vlan and pool
Set up common 2VM prerequisites.

Add rx vlan-id 3 of VF1, and 2 mirror rules, one is VM0 income traffic 
to VM1,
one is VM1 vlan income traffic to VM0::

PF testpmd-> rx_vlan add 3 port 0 vf 0x2
PF testpmd-> set port 0 mirror-rule 0 pool-mirror-up 0x1 
dst-pool 1 on
PF testpmd-> set port 0 mirror-rule 1 vlan-mirror 3 dst-pool 0 
on

Send 2 flows one by one, first 10 packets with VM0 mac, and the second 
100
packets with VM1 vlan and mac, and verify the first 10 packets has been
mirrored first to VM1, second 100 packets go to VM0 and the packets 
have been
forwarded.

After test need reset mirror rule::

PF testpmd-> reset port 0 mirror-rule 0
PF testpmd-> reset port 0 mirror-rule 1

 - Case: Mirror Traffic between 2VMs with Uplink & Downlink mirroring
   Description: Verify the misc mirror rules of uplink and downlink
Run testpmd on VM0 and VM1 and start traffic forward on the VM hosts::

VF0 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 --  -i
VF1 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 --  -i
Add 2 mirror rules that will mirror VM0 outcome and income traffic to 
VM1::

PF testpmd-> set port 0 mirror-r

[dpdk-dev] [PATCH] ixgbe: fix buffer overrun bug in non-bulk alloc mode setup

2015-03-23 Thread Jiajia, SunX
Hi Thomas,

> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Saturday, March 21, 2015 5:46 AM
> To: Jiajia, SunX
> Cc: dev at dpdk.org; Wodkowski, PawelX
> Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix buffer overrun bug in non-
> bulk alloc mode setup
> 
> 2015-03-20 06:50, Jiajia, SunX:
> > Tested-by: Jiajia, SunX 
> > - Tested Commit: fe4810a01e57645ad92577d628f562791408ce21
> 
> This commit id is related to a PDF doc change.

I verify this issue based on this commit id which is not the commit id I found, 
Sorry for making you confused. BTW, I found this issue in the 
dpdk-2.0.0-rc2, which commit id is 1a5994ac2ce11c112d9eed69c08311b31ac7f3d2.

> 
> > - OS: Fedora20 3.11.10-301.fc20.x86_64
> > - GCC: gcc version 4.8.3
> > - CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
> > - NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network
> Connection [8086:10fb]
> > - Target x86_64-native-linuxapp-gcc
> > - Total 22 cases, 22 passed, 0 failed
> 
> It seems this test is related to bonding, not ixgbe buffer overrun in
> non-bulk alloc mode.

Because I found this issue when doing the test of bonding, so I think doing
Bonding test should work on verifying this issue. 

> 
> > TOPO:
> > * Connections ports between tester/ixia and DUT
> >   - TESTER(Or IXIA)---DUT
> >   - portA--port0
> >   - portB--port1
> >   - portC--port2
> >   - portD--port3
> >
> > Test Setup#1 for Functional test
> > 
> >
> > Tester has 4 ports(portA--portD), and DUT has 4 ports(port0--port3),
> then connect portA to port0, portB to port1, portC to port2, portD to
> port3.
> >
> >
> >
> > - Case: Basic bonding--Create bonded devices and slaves
> >   Description:
> > Use Setup#1.
> > Create bonded device and add some ports as salve of bonded
> device,
> > Then removed slaves or added slaves or change the bonding
> primary slave
> > Or change bonding mode and so on.
> >   Expected test result:
> > Verify the basic functions are normal.
> >
> > - Case: Basic bonding--MAC Address Test
> >   Description:
> > Use Setup#1.
> > Create bonded device and add some ports as slaves of bonded
> device,
> > Check that the changes of  the bonded device and slave
> MAC
> >   Expected test result:
> > Verify the behavior of bonded device and slave according
> to the mode.
> >
> > - Case: Basic bonding--Device Promiscuous Mode Test
> >   Description:
> > Use Setup#1.
> > Create bonded device and add some ports as slaves of bonded
> device,
> > Set promiscuous mode on or off, then send packets to the
> bonded device
> > Or slaves.
> >   Expected test result:
> > Verify the RX/TX status of bonded device and slaves
> according to the mode.
> >
> > - Case: Mode 0(Round Robin) TX/RX test
> >   Description:
> > Use Setup#1.
> > Create bonded device with mode 0 and add 3 ports as slaves
> of bonded device,
> > Forward packets between bonded device and unbounded
> device, start to forward,
> > And send packets to unbound device or slaves.
> >   Expected test result:
> > Verify the RX/TX status of bonded device and slaves in
> mode 0.
> >
> > - Case: Mode 0(Round Robin) Bring one slave link down
> >   Description:
> > Use Setup#1.
> > Create bonded device with mode 0 and add 3 ports as slaves
> of bonded device,
> > Forward packets between bonded device and unbounded
> device, start to forward,
> > Bring the link on either port 0, 1 or 2 down. And send
> packets to unbound
> > device or slaves.
> >   Expected test result:
> > Verify the RX/TX status of bonded device and slaves in
> mode 0.
> >
> > - Case: Mode 0(Round Robin) Bring all slave links down
> >   Description:
> > Use Setup#1.
> > Create bonded device with mode 0 and add 3 ports as slaves
> of bonded device,
> > Forward packets between bonded device and unbounded
> device, start to forward,
> > Bring the links down on all bonded ports. And send
> packets to unbound
> > device or slaves.
> >   Expected test result:
> > Verify the RX/T

[dpdk-dev] [PATCH] ixgbe: fix buffer overrun bug in non-bulk alloc mode setup

2015-03-20 Thread Jiajia, SunX
Tested-by: Jiajia, SunX 
- Tested Commit: fe4810a01e57645ad92577d628f562791408ce21
- OS: Fedora20 3.11.10-301.fc20.x86_64
- GCC: gcc version 4.8.3
- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection 
[8086:10fb]
- Target x86_64-native-linuxapp-gcc
- Total 22 cases, 22 passed, 0 failed

TOPO:
* Connections ports between tester/ixia and DUT
  - TESTER(Or IXIA)---DUT
  - portA--port0
  - portB--port1
  - portC--port2
  - portD--port3

Test Setup#1 for Functional test


Tester has 4 ports(portA--portD), and DUT has 4 ports(port0--port3), then 
connect portA to port0, portB to port1, portC to port2, portD to port3. 



- Case: Basic bonding--Create bonded devices and slaves
  Description: 
Use Setup#1.
Create bonded device and add some ports as salve of bonded 
device,
Then removed slaves or added slaves or change the bonding primary 
slave
Or change bonding mode and so on.
  Expected test result:
Verify the basic functions are normal.

- Case: Basic bonding--MAC Address Test
  Description: 
Use Setup#1.
Create bonded device and add some ports as slaves of bonded 
device,
Check that the changes of  the bonded device and slave MAC
  Expected test result:
Verify the behavior of bonded device and slave according to the 
mode.

- Case: Basic bonding--Device Promiscuous Mode Test
  Description: 
Use Setup#1.
Create bonded device and add some ports as slaves of bonded 
device,
Set promiscuous mode on or off, then send packets to the bonded 
device
Or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves according to 
the mode.

- Case: Mode 0(Round Robin) TX/RX test
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
And send packets to unbound device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 0(Round Robin) Bring one slave link down
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
Bring the link on either port 0, 1 or 2 down. And send packets to 
unbound 
device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 0(Round Robin) Bring all slave links down
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
Bring the links down on all bonded ports. And send packets to 
unbound 
device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 1(Active Backup) TX/RX Test
  Description: 
Use Setup#1.
Create bonded device with mode 1 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
And send packets to unbound device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 1.

- Case: Mode 1(Active Backup) Change active slave, RX/TX test
  Description: 
Use Setup#1.
Continuing from previous test case.Change the active slave port 
from port0 
to port1.Verify that the bonded device's MAC has changed to 
slave1's MAC.

testpmd> set bonding primary 1 4 

   Repeat the transmission and reception(TX/RX) test verify that data 
is now 
   transmitted and received through the new active slave and no longer 
through
   port0
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 1.

- Case: Mode 1(Active Backup) Link up/down active eth dev
  Description: 
Use Setup#1.

   Bring link between port A and port0 down. If tester is ixia, can use 
   IxExplorer to set the "Simulate Cable Disconnect" at the port 
property.  
   Verify that the active slave has been changed from port0. Repeat the 
   transmission and reception test verify that data is now transmitted 
and
   received through the new active slave and no longer through port0

   Bring port0 to link down at the remo

[dpdk-dev] [PATCH] testpmd: bond port creation did not enable bond port

2015-03-09 Thread Jiajia, SunX
Tested-by: Jiajia, SunX 
- Tested Commit: 391b5f425c4613e649e5353ed8161e75967b0f3a
- OS: Fedora20 3.11.10-301.fc20.x86_64
- GCC: gcc version 4.8.3
- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection 
[8086:10fb]
- Target x86_64-native-linuxapp-gcc 
- Total 22 cases, 22 passed, 0 failed

TOPO:
* Connections ports between tester/ixia and DUT
  - TESTER(Or IXIA)---DUT
  - portA--port0
  - portB--port1
  - portC--port2
  - portD--port3


Test Setup#1 for Functional test


Tester has 4 ports(portA--portD), and DUT has 4 ports(port0--port3), then 
connect portA to port0, 
portB to port1, portC to port2, portD to port3. 



- Case: Basic bonding--Create bonded devices and slaves
  Description: 
Use Setup#1.
Create bonded device and add some ports as salve of bonded 
device,
Then removed slaves or added slaves or change the bonding primary 
slave
Or change bonding mode and so on.
  Expected test result:
Verify the basic functions are normal.

- Case: Basic bonding--MAC Address Test
  Description: 
Use Setup#1.
Create bonded device and add some ports as slaves of bonded 
device,
Check that the changes of  the bonded device and slave MAC
  Expected test result:
Verify the behavior of bonded device and slave according to the 
mode.

- Case: Basic bonding--Device Promiscuous Mode Test
  Description: 
Use Setup#1.
Create bonded device and add some ports as slaves of bonded 
device,
Set promiscuous mode on or off, then send packets to the bonded 
device
Or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves according to 
the mode.

- Case: Mode 0(Round Robin) TX/RX test
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
And send packets to unbound device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 0(Round Robin) Bring one slave link down
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
Bring the link on either port 0, 1 or 2 down. And send packets to 
unbound 
device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 0(Round Robin) Bring all slave links down
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
Bring the links down on all bonded ports. And send packets to 
unbound 
device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 1(Active Backup) TX/RX Test
  Description: 
Use Setup#1.
Create bonded device with mode 1 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
And send packets to unbound device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 1.

- Case: Mode 1(Active Backup) Change active slave, RX/TX test
  Description: 
Use Setup#1.
Continuing from previous test case.Change the active slave port 
from port0 
to port1.Verify that the bonded device's MAC has changed to 
slave1's MAC.

testpmd> set bonding primary 1 4 

   Repeat the transmission and reception(TX/RX) test verify that data 
is now 
   transmitted and received through the new active slave and no longer 
through
   port0
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 1.

- Case: Mode 1(Active Backup) Link up/down active eth dev
  Description: 
Use Setup#1.

   Bring link between port A and port0 down. If tester is ixia, can use 
   IxExplorer to set the "Simulate Cable Disconnect" at the port 
property.  
   Verify that the active slave has been changed from port0. Repeat the 
   transmission and reception test verify that data is now transmitted 
and
   received through the new active slave and no longer through port0

   Bring port0 to link down at the remo

[dpdk-dev] [PATCH v4 0/6] Link Bonding mode 6 support (ALB)

2015-03-04 Thread Jiajia, SunX
Tested-by: Jiajia, SunX 

- Tested Commit: 8bfc4e3c4cb922d9c7e6b8934fdaffba268c7ed2
- OS: Fedora20 3.11.10-301.fc20.x86_64
- GCC: gcc version 4.8.3
- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection 
[8086:10fb]
- Target x86_64-native-linuxapp-gcc 
- Total 3 cases, 3 passed, 0 failed


* Connections ports between tester/ixia and switch and DUT
  - TESTER(Or IXIA)---SWITCH
  -   SWITCH-DUT
  - TESTER(Or IXIA)--DUT
  - portA--switch
  -switch--port0
  -switch--port1
  -switch--port2
  - portB--port3
* Connections ports between tester/ixia and switch and DUT
  - TESTER(Or IXIA)---SWITCH
  -   SWITCH-DUT
  - TESTER(Or IXIA)--DUT
  - portA-switch
  - portB-switch
  - portC-switch
  -   switch--port0
  -   switch--port1
  -   switch--port2

Test Setup#1 for Functional test


Tester has 4 ports(portA--portD), and DUT has 4 ports(port0--port3), then 
connect portA to port0, portB to port1, portC to port2, portD to port3. 


Test Setup#2 for Functional test


Tester has 2 ports(portA--portB), DUT has 4 ports(port0--port3), and a switch 
that supports IEEE 802.3ad Dynamic link aggregation, then connect port0-port2 
to the switch for dynamic link aggregation, connect portA to aggregated 
interface on the switch, connect portB to port3. 

Test Setup#3 for Functional test


Tester has 3 ports(portA--portC), DUT has 3 ports(port0--port2), and a switch, 
then connect port0-port2 to three ports on the switch, connect portA - portB to 
the other three ports on the switch. 

Test App
===

Use testpmd to test the mode 0, 1, 2, 3, 4, 5, use bond_app to test the mode 6. 
If test the mode 6, Set the tester port address to 
7.0.0.1, 7.0.0.2, 7.0.0.3. And it will be better to turn on the debug switch on 
the config:
CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB=n - deeper debug, if you want all arp and ipv4 
packets be printed 
CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB_L1=n - don't print packets information, just 
collects statistics from clients, you can print these statistics with show 
command.


Test Case1: Mode 6(Adaptive load balance) Basic test
=

Verify basic commands of bond_app work well.

Use Setup#3

Now bond_app has commands of send, start, stop, show, help, quit
help:

  execute command 'help' in the bond_app, verify it will print all commands 
help info.

send:

  make sure that bond_app has been started, execute command 'send 
7.0.0.1' on server, use 
  tcpdump to listen client1 port , verify the port will receive ARP 
requests.

start:

  step1:
execute command 'stop' in the bond_app, then execute 'arping -c 1 
-I device 7.0.0.10' on the client1,
verify bond_app will not receive and reply the client1 ARP request.
  Step2:
Execute command 'start' in the bond_app, then execute 'arping -c 1 
-I device 7.0.0.10' on the client1,
Verify bond_app will receive and reply the client1 ARP request.

stop:

 continue the test of  command 'start', rerun step1.

show:

 execute command 'show' in the bond_app, verify it will print  some bond 
info: ex. active slaves etc.

quit:

 execute command 'quit' in the bond_app, verify it will terminate all 
threads and quit.

Verify bond_app can check the state of slaves, and do some actions.

Use Setup#1

Start bond_app.

Step1:

  Send 1 ARP request packet to bond0 from client1, verify it will receive 
and reply it on one slave.

Step2:

  Bring the port of client1 link down,  verify bond0 will detect the 
change of slaves, by the command
  'show' to check the state of bond0, verify there are just two slaves.

Step3:

  Send 1 ARP request packet to bond0 on bond1 from client1, verify it will 
receive nothing.


Test Case2: Mode 6(Adaptive load balance) RX test of mode6
=

Verify bond device can receive load balancing for IPV4 traffic.

Use Setup#3

Step1:

  Send ARP request packet (no VLAN header) to bond0 from each client, 
verify bond0 will choose 
  different slave to reply the request by the policy of round-robin.
  You can use the command 'arping -c 1 -I device 7.0.0.10' to server on 
each client. The device will
  need you to change it to the interface name of your client.

Step2:

  Send ARP request packet tagged with VLAN header to bond0 from each 
client

[dpdk-dev] [PATCH v2] bond: vlan flags misinterpreted in xmit_slave_hash function

2015-01-07 Thread Jiajia, SunX
Tested-by: Jiajia, SunX 
- Tested Commit: 6fb3161060fc894295a27f9304c56ef34492799d
- OS: Fedora20 3.11.10-301.fc20.x86_64
- GCC: gcc version 4.8.3
- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection 
[8086:10fb]
- Target x86_64-native-linuxapp-gcc and i686-native-linuxapp-gcc
- Total 44 cases, 44 passed, 0 failed

TOPO:
* Connections ports between tester/ixia and DUT
  - TESTER(Or IXIA)---DUT
  - portA--port0
  - portB--port1
  - portC--port2
  - portD--port3


Test Setup#1 for Functional test


Tester has 4 ports(portA--portD), and DUT has 4 ports(port0--port3), then 
connect portA to port0, portB to port1, portC to port2, portD to port3. 



- Case: Basic bonding--Create bonded devices and slaves
  Description: 
Use Setup#1.
Create bonded device and add some ports as salve of bonded 
device,
Then removed slaves or added slaves or change the bonding primary 
slave
Or change bonding mode and so on.
  Expected test result:
Verify the basic functions are normal.

- Case: Basic bonding--MAC Address Test
  Description: 
Use Setup#1.
Create bonded device and add some ports as slaves of bonded 
device,
Check that the changes of  the bonded device and slave MAC
  Expected test result:
Verify the behavior of bonded device and slave according to the 
mode.

- Case: Basic bonding--Device Promiscuous Mode Test
  Description: 
Use Setup#1.
Create bonded device and add some ports as slaves of bonded 
device,
Set promiscuous mode on or off, then send packets to the bonded 
device
Or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves according to 
the mode.

- Case: Mode 0(Round Robin) TX/RX test
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
And send packets to unbound device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 0(Round Robin) Bring one slave link down
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
Bring the link on either port 0, 1 or 2 down. And send packets to 
unbound 
device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 0(Round Robin) Bring all slave links down
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
Bring the links down on all bonded ports. And send packets to 
unbound 
device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 1(Active Backup) TX/RX Test
  Description: 
Use Setup#1.
Create bonded device with mode 1 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
And send packets to unbound device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 1.

- Case: Mode 1(Active Backup) Change active slave, RX/TX test
  Description: 
Use Setup#1.
Continuing from previous test case.Change the active slave port 
from port0 
to port1.Verify that the bonded device's MAC has changed to 
slave1's MAC.

testpmd> set bonding primary 1 4 

   Repeat the transmission and reception(TX/RX) test verify that data 
is now 
   transmitted and received through the new active slave and no longer 
through
   port0
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 1.

- Case: Mode 1(Active Backup) Link up/down active eth dev
  Description: 
Use Setup#1.

   Bring link between port A and port0 down. If tester is ixia, can use 
   IxExplorer to set the "Simulate Cable Disconnect" at the port 
property.  
   Verify that the active slave has been changed from port0. Repeat the 
   transmission and reception test verify that data is now transmitted 
and
   received through the new active slave and no longer through port0

   Bring port0

[dpdk-dev] [PATCH v2] ADD mode 5(tlb) to link bonding pmd

2014-11-25 Thread Jiajia, SunX
Tested-by: Jiajia, SunX 
- Tested Commit: f7aaae2fe6f7f9a78eab7313d77e92b934693b5d
- OS: Fedora20 3.11.10-301.fc20.x86_64 and 3.16.6-200.fc20.x86_64
- GCC: gcc version 4.8.2
- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection 
[8086:10fb]
- Default x86_64-native-linuxapp-gcc configuration
- Total 4 cases, 4 passed, 0 failed

TOPO:
Setup#1
* Connections ports between tester/ixia and DUT
  - TESTER(Or IXIA)---DUT
  - portA--port0
  - portB--port1
  - portC--port2
  - portD--port3

Test Case1: Mode 5(Transmit load balance) basic test


Use Setup#1

Create bonded device. Add first slave - port 0. Verify default bonded device 
has default mode 5. Verify bonded device MAC address is that of primary slave. 
Add another slaves port 1 and 2 to the bonded device. Verify that their MAC are 
different.

Bring the primary slave down. Verify if bonding interface reconfigured itself. 
The next port (in this scenario port 1) should became a primary one but the MAC 
should not be changed - should still be the MAC of port 0.

Bring a slave of bonding device down. Verify if bonding interface reconfigured 
itself.

Bring the portA, portB and portC down. Verify the bonded device will link down.

Set bonded device promiscuous mode to be off. Verify only the promiscuous state 
of primary interface will be off.


Test Case2: Mode 5(Transmit load balance)  TX/RX test


Use Setup#1

Create a bonded device(port4 in this scenario). Add port 0-2 as slaves of 
bonding port4. Make packets to transmit between port3 and port4. Then start to 
forward streams.

TX: Prepare a packet stream which will send packets in 5 minutes. Send this 
stream from portD to port3. Verify that port3 will receive all packets---no 
missed packets and no error packets. Port 0-2 transmitting packets will be 
represented as packet0, packet1 and packet2 respectively and their average 
packets will be represented as mean.  Then verify port 0-2 will meet the 
situation:
mean = (packet0 + packet1 + packet2)/3, packet0, packet1 and packet2 will be 
higher than 90% of mean and lower than 110% of mean. Then the test of port0, 
port1 and port2 balancing are finished positive.

RX: A continuation of TX testing setup. Prepare 3 packet streams and each 
stream has 100 packets. Respectively, send these streams from portA, portB and 
portC. Verify only the primary slave port0 will receive 100 packets, and port3 
will transmit 100 packets.


Test Case3: Mode 5(Transmit load balance)  Bring one slave link down


Use Setup#1

Create a bonded device(port4 in this scenario). Add port0, port1 and port2 as 
slaves of bonding port4. Make packets to transmit between port3 and port4. Then 
start to forward streams.

TX: Prepare a packet stream which will send packets in 5 minutes. Bringing 
port0 link down in the remote end. Send this stream from portD to port3. After 
the time of 5 minutes is out, verify that port3 will receive all packets---no 
missed packets and no error packets. Port 1-2 transmitting packets will be 
represented as packet1 and packet2 respectively and their average packets will 
be represented as mean. Then verify port1 and port2 will meet the situation:
mean = (packet1 + packet2)/2, packet1 and packet2 will be higher than 90% of 
mean and lower than 110% of mean. Then the test of port1 and port2 balancing 
are finished positive.

RX: Prepare 3 packet streams and each stream has 100 packets. Respectively, 
send these streams from portA, portB and portC. Verify the primary port(port0 
this scenario) will receive 100 packets, and port1 and port2 will receive 
nothing, and port3 will transmit 100 packets.


Test Case4: Mode 5(Transmit load balance)  Bring all slaves link down
=

Use Setup#1

First, set the same setup as case 30. Second, bring all slaves link down.

TX: Prepare 1 packet stream which will have 300 packets. Send this stream from 
portD to port3. Verify port0, port1 and port2 will transmit nothing.

RX: Prepare 3 packet streams and each stream has 100 packets. Respectively, 
send these streams from portA, portB and portC. Verify port0, port1 and port2 
will receive nothing.

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Doherty, Declan
> Sent: Tuesday, October 07, 2014 4:20 PM
> To: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] ADD mode 5(tlb) to link bonding pmd
> 
> 
> 
> > -Original Message-
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Daniel Mrzyglod
> > Sent: Friday, September 26, 2014 4:41 PM
> > To

[dpdk-dev] [PATCH v6 0/8] link bonding

2014-11-21 Thread Jiajia, SunX
Tested-by: Jiajia, SunX 
- Tested Commit: f7aaae2fe6f7f9a78eab7313d77e92b934693b5d
- OS: Fedora20 3.11.10-301.fc20.x86_64 and 3.16.6-200.fc20.x86_64
- GCC: gcc version 4.8.2
- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection 
[8086:10fb]
- Default x86_64-native-linuxapp-gcc configuration
- Total 18 cases, 18 passed, 0 failed

TOPO:
* Connections ports between tester/ixia and DUT
  - TESTER(Or IXIA)---DUT
  - portA--port0
  - portB--port1
  - portC--port2
  - portD--port3
* Connections ports between tester/ixia and switch and DUT
  - TESTER(Or IXIA)---SWITCH
  -   SWITCH-DUT
  - TESTER(Or IXIA)--DUT
  - portA--switch
  -switch--port0
  -switch--port1
  -switch--port2
  - portB--port3


Test Setup#1 for Functional test


Tester has 4 ports(portA--portD), and DUT has 4 ports(port0--port3), then 
connect portA to port0, portB to port1, portC to port2, portD to port3. 


Test Setup#2 for Functional test


Tester has 2 ports(portA--portB), DUT has 4 ports(port0--port3), and a switch 
that supports IEEE 802.3ad Dynamic link aggregation, then connect port0-port2 
to the switch for dynamic link aggregation, connect portA to aggregated 
interface on the switch, connect portB to port3.


- Case: Basic bonding--Create bonded devices and slaves
  Description: 
Use Setup#1.
Create bonded device and add some ports as salve of bonded 
device,
Then removed slaves or added slaves or change the bonding primary 
slave
Or change bonding mode and so on.
  Expected test result:
Verify the basic functions are normal.

- Case: Basic bonding--MAC Address Test
  Description: 
Use Setup#1.
Create bonded device and add some ports as slaves of bonded 
device,
Check that the changes of  the bonded device and slave MAC
  Expected test result:
Verify the behavior of bonded device and slave according to the 
mode.

- Case: Basic bonding--Device Promiscuous Mode Test
  Description: 
Use Setup#1.
Create bonded device and add some ports as slaves of bonded 
device,
Set promiscuous mode on or off, then send packets to the bonded 
device
Or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves according to 
the mode.

- Case: Mode 0(Round Robin) TX/RX test
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
And send packets to unbound device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 0(Round Robin) Bring one slave link down
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
Bring the link on either port 0, 1 or 2 down. And send packets to 
unbound 
device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 0(Round Robin) Bring all slave links down
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
Bring the links down on all bonded ports. And send packets to 
unbound 
device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 1(Active Backup) TX/RX Test
  Description: 
Use Setup#1.
Create bonded device with mode 1 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
And send packets to unbound device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 1.

- Case: Mode 1(Active Backup) Change active slave, RX/TX test
  Description: 
Use Setup#1.
Continuing from previous test case.Change the active slave port 
from port0 
to port1.Verify that the bonded device's MAC has changed to 
slave1's MAC.

testpmd> set bonding primary 1 4 

   Repeat the transmission and reception(TX/RX) test ver

[dpdk-dev] [PATCH v5 0/8] link bonding

2014-11-05 Thread Jiajia, SunX
Tested-by: Jiajia, SunX  
- Tested Commit: f7aaae2fe6f7f9a78eab7313d77e92b934693b5d
- OS: Fedora20 3.11.10-301.fc20.x86_64 and 3.16.6-200.fc20.x86_64
- GCC: gcc version 4.8.2
- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection 
[8086:10fb]
- Default x86_64-native-linuxapp-gcc configuration
- Total 18 cases, 18 passed, 0 failed

TOPO:
* Connections ports between tester/ixia and DUT
  - TESTER(Or IXIA)---DUT
  - portA--port0
  - portB--port1
  - portC--port2
  - portD--port3
* Connections ports between tester/ixia and switch and DUT
  - TESTER(Or IXIA)---SWITCH
  -   SWITCH-DUT
  - TESTER(Or IXIA)--DUT
  - portA--switch
  -switch--port0
  -switch--port1
  -switch--port2
  - portB--port3


Test Setup#1 for Functional test


Tester has 4 ports(portA--portD), and DUT has 4 ports(port0--port3), then 
connect portA to port0, portB to port1, portC to port2, portD to port3. 


Test Setup#2 for Functional test


Tester has 2 ports(portA--portB), DUT has 4 ports(port0--port3), and a switch 
that supports IEEE 802.3ad Dynamic link aggregation, then connect port0-port2 
to the switch for dynamic link aggregation, connect portA to aggregated 
interface on the switch, connect portB to port3.


- Case: Basic bonding--Create bonded devices and slaves
  Description: 
Use Setup#1.
Create bonded device and add some ports as salve of bonded 
device,
Then removed slaves or added slaves or change the bonding primary 
slave
Or change bonding mode and so on.
  Expected test result:
Verify the basic functions are normal.

- Case: Basic bonding--MAC Address Test
  Description: 
Use Setup#1.
Create bonded device and add some ports as slaves of bonded 
device,
Check that the changes of  the bonded device and slave MAC 
  Expected test result:
Verify the behavior of bonded device and slave according to the 
mode.

- Case: Basic bonding--Device Promiscuous Mode Test
  Description: 
Use Setup#1.
Create bonded device and add some ports as slaves of bonded 
device,
Set promiscuous mode on or off, then send packets to the bonded 
device
Or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves according to 
the mode.

- Case: Mode 0(Round Robin) TX/RX test
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
And send packets to unbound device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 0(Round Robin) Bring one slave link down
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
Bring the link on either port 0, 1 or 2 down. And send packets to 
unbound 
device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 0(Round Robin) Bring all slave links down
  Description: 
Use Setup#1.
Create bonded device with mode 0 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
Bring the links down on all bonded ports. And send packets to 
unbound 
device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 0.

- Case: Mode 1(Active Backup) TX/RX Test
  Description: 
Use Setup#1.
Create bonded device with mode 1 and add 3 ports as slaves of 
bonded device,
Forward packets between bonded device and unbounded device, start 
to forward,
And send packets to unbound device or slaves.
  Expected test result:
Verify the RX/TX status of bonded device and slaves in mode 1.

- Case: Mode 1(Active Backup) Change active slave, RX/TX test
  Description: 
Use Setup#1.
Continuing from previous test case.Change the active slave port 
from port0 
to port1.Verify that the bonded device's MAC has changed to 
slave1's MAC.

testpmd> set bonding primary 1 4 

   Repeat the transmission and reception(TX/RX) test ver

[dpdk-dev] [PATCH v4 0/8] link bonding

2014-10-08 Thread Jiajia, SunX
Tested-by: Jiajia, SunX 

This patch has been verified on FC20 with Niantic.
The test environment detail information as the following:

CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
OS: Linux  3.11.10-301.fc20.x86_64
GCC: 4.8.2
NIC: Niantic.

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Declan Doherty
> Sent: Tuesday, September 30, 2014 5:58 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v4 0/8] link bonding
> 
> v4:
> - Rebased to account for changes in master.
> - Fix for rte_eth_bond_slaves_get() introduced in v3 patch set
> - Addressed issue around disabling/enabling link status polling around
> adding/
>   removing slaves devices.
> 
> v3 :
> - Typo fix for the bond free mbufs patch.
> - Rebased to account for changes in the mbuf patches.
> - Add support for slave devices which don't support link status
> interrupts
> - Tidy up the link bonding unit test so that all tests use the new test
> macros.
> 
> v2 :
> Addresses issues with the logic around the handling of fail
> transmissions.
> In this version all modes behave in a manner similar to a standard PMD,
> returning the number of successfully transmitted mbufs and with the
> failing
> mbufs at the end of bufs array for freeing / retransmission by the
> application software
> 
> v1:
> 
> This patch set adds support for link status interrupt in the link
> bonding
> pmd. It also contains some patches to tidy up the code structure and to
> of the link bonding code and to fix bugs relating to transmission
> failures in the under lying slave pmd which could lead to leaked mbufs.
> 
> Declan Doherty (8):
>   bond: link status interrupt support
>   bond: removing switch statement from rx burst method
>   bond: fix naming inconsistency in tx_burst_round_robin
>   bond: free mbufs if transmission fails in bonding tx_burst functions
>   test app: adding support for generating variable sized packet
>   testpmd: adding parameter to reconfig method to set socket_id when
> adding new port to portlist
>   bond: lsc polling support
>   bond: unit test test macro refactor
> 
>  app/test-pmd/cmdline.c |   65 +-
>  app/test-pmd/testpmd.c |3 +-
>  app/test-pmd/testpmd.h |2 +-
>  app/test/packet_burst_generator.c  |   25 +-
>  app/test/packet_burst_generator.h  |6 +-
>  app/test/test.h|7 +-
>  app/test/test_link_bonding.c   | 3342 ++--
> 
>  app/test/virtual_pmd.c |   97 +-
>  app/test/virtual_pmd.h |   53 +-
>  lib/librte_pmd_bond/rte_eth_bond.h |   80 +
>  lib/librte_pmd_bond/rte_eth_bond_api.c |  319 ++-
>  lib/librte_pmd_bond/rte_eth_bond_args.c|   30 +-
>  lib/librte_pmd_bond/rte_eth_bond_pmd.c |  550 +++--
>  lib/librte_pmd_bond/rte_eth_bond_private.h |   71 +-
>  14 files changed, 2692 insertions(+), 1958 deletions(-)
> 
> --
> 1.7.12.2



[dpdk-dev] [PATCH 0/6] link bonding

2014-08-22 Thread Jiajia, SunX
Tested-by: Jiajia, SunX < sunx.jiajia at intel.com>

These patches have be verified, and are ready to integrate into DPDK.org.

There are 18 test cases in this feature now. All cases are passed. Please see 
the test result as following: 

active_backup_all_slave_downPASSED
active_backup_change_primaryPASSED
active_backup_one_slave_downPASSED
active_backup_rx_tx PASSED
bonded_mac_address  PASSED
broadcast_rx_tx PASSED
broadcast_tx_all_slave_down PASSED
broadcast_tx_one_slave_down PASSED
create_bonded_devices_and_slavesPASSED
device_promiscuous_mode PASSED
round_robin_all_slave_down  PASSED
round_robin_one_slave_down  PASSED
round_robin_rx_tx   PASSED
xor_l34_forward PASSED
xor_rx  PASSED
xor_tx  PASSED
xor_tx_all_slave_down   PASSED
xor_tx_one_slave_down   PASSED

Test environment: Fedora 20, 3.11.10-301.fc20.x86_64, GCC 4.8.2, Intel Xeon 
processor E5-2680 v2, with Intel Niantic 82599.

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Declan Doherty
> Sent: Tuesday, August 19, 2014 9:52 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH 0/6] link bonding
> 
> This patch set adds support for link status interrupt in the link
> bonding
> pmd. It also contains some patches to tidy up the code structure and to
> of the link bonding code and to fix bugs relating to transmission
> failures in the under lying slave pmd which could lead to leaked mbufs.
> 
> 
> Declan Doherty (6):
>   bond: link status interrupt support
>   bond: removing switch statement from rx burst method
>   bond: fix naming inconsistency in tx_burst_round_robin
>   bond: free mbufs if transmission fails in bonding tx_burst functions
>   test app: adding support for generating variable sized packets
>   testpmd: adding parameter to reconfig method to set socket_id when
> adding new port to portlist
> 
>  app/test-pmd/cmdline.c |2 +-
>  app/test-pmd/testpmd.c |3 +-
>  app/test-pmd/testpmd.h |2 +-
>  app/test/packet_burst_generator.c  |   22 +--
>  app/test/packet_burst_generator.h  |6 +-
>  app/test/test_link_bonding.c   |  234
> ++--
>  lib/librte_pmd_bond/rte_eth_bond_api.c |4 +
>  lib/librte_pmd_bond/rte_eth_bond_pmd.c |  124 +++--
>  8 files changed, 295 insertions(+), 102 deletions(-)



[dpdk-dev] [PATCH] pcap: Fixed bug in eth_pcap_rx function

2014-08-12 Thread Jiajia, SunX
Tested-by: Jiajia SunX   

This patch fixed a bug by changing eth_pcap_rx function, and is ready to 
integrate into DPDK.org.

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Pablo de Lara
> Sent: Tuesday, August 05, 2014 6:18 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH] pcap: Fixed bug in eth_pcap_rx function
> 
> Normally, bufs[i] stores the mbuf pointer, the index of buf[i]
> is the loop count i, but if header.len > buf_size, DPDK will
> free the mbuf, but the loop count i still increases, so some
> of the items in bufs[] might be NULL ponter, causing a potential
> DPDK core. Using num_rx as the index for bufs[] solves the problem.
> 
> Signed-off-by: Pablo de Lara 
> ---
>  lib/librte_pmd_pcap/rte_eth_pcap.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/librte_pmd_pcap/rte_eth_pcap.c
> b/lib/librte_pmd_pcap/rte_eth_pcap.c
> index c77ee25..eebe768 100644
> --- a/lib/librte_pmd_pcap/rte_eth_pcap.c
> +++ b/lib/librte_pmd_pcap/rte_eth_pcap.c
> @@ -154,7 +154,7 @@ eth_pcap_rx(void *queue,
>   rte_memcpy(mbuf->pkt.data, packet, header.len);
>   mbuf->pkt.data_len = (uint16_t)header.len;
>   mbuf->pkt.pkt_len = mbuf->pkt.data_len;
> - bufs[i] = mbuf;
> + bufs[num_rx] = mbuf;
>   num_rx++;
>   } else {
>   /* pcap packet will not fit in the mbuf, so drop
> packet */
> --
> 1.7.0.7