DPDK CI discussions
 help / color / mirror / Atom feed
From: "Etelson, Gregory" <getelson@nvidia.com>
To: "Thomas Monjalon" <thomas@monjalon.net>,
	"Juraj Linkeš" <juraj.linkes@pantheon.tech>,
	"Honnappa Nagarahalli" <honnappa.nagarahalli@arm.com>,
	"Paul Szczepanek" <Paul.Szczepanek@arm.com>,
	"Luca Vizzarro" <Luca.Vizzarro@arm.com>,
	"Yoan Picchi" <yoan.picchi@foss.arm.com>,
	"Jeremy Spewock" <jspewock@iol.unh.edu>,
	"Gregory Etelson" <getelson@nvidia.com>,
	"Patrick Robb" <probb@iol.unh.edu>, "ci@dpdk.org" <ci@dpdk.org>,
	dev@dpdk.org
Subject: DTS testpmd and SCAPY integration
Date: Tue, 26 Dec 2023 09:31:46 +0200 (IST)	[thread overview]
Message-ID: <2a287ee7-cda4-f2ab-a4e6-a47021f8573f@nvidia.com> (raw)

Hello,

Consider an option to describe DTS test with testpmd and SCAPY plain text 
commands.

For example:

Scenario:
  - Configure UDP packet in SCAPY and a flow in testpmd.
  - Send UDP packet and validate testpmd output triggered by that packet.

```yaml
phase_0:
     name: CONFIGURATION
     tg: |
         udp_pkt = Ether()/IP()/UDP(sport=31)/Raw('== TEST ==')
         print('packet is ready')
     dut: |
         start
         set verbose 1
         flow create 0 ingress pattern eth / ipv4 / udp src is 31 / end actions queue index 1 / end
     result:
         dut: 'Flow rule #0 created'
         tg: 'packet is ready'

phase_1:
     name: SEND and VALIDATE
     tg: sendp(udp_pkt, iface=pf0)
     result:
         dut: '- RSS queue=0x1 -'
```

Test described as a sequence of phases.

Phase definition:
~~~~~~~~~~~~~~~~

```
<phase id>: # unique phase ID
     name: <phase name>                       # phase name
     <application ID (APP1)>: <APP1 commands> # application APP1 commands
     ...
     <application ID (APPy)>: <APPy commands> # application APPy commands
     ...
     <application ID (APPx)>: <APPx commands> # application APPx commands

     result:                # optional phase results verification section
         <application ID APPx>: <expected output>  # APPx expected output
         ...
         <application ID APPy>: <expected output>  # APPy expected output
```

- Application commands in a phase executed sequentially,
   in order of application IDs: <APPy> commands executed
   before <APPx> commands.

- Application results in a phase validated sequentially,
   in order of application IDs: <APPx> result validated
   before APPy result.

- Application result is a regular expression.


Test application definition:
~~~~~~~~~~~~~~~~~~~~~~~~~~~

```
<application ID>: # unique application ID
     agent:        # mandatory application type identifier: {testpmd|scapy}
     cmd:          # optional application command template
```

Example:

```yaml

dut:
     agent: testpmd
     cmd: 'dpdk-testpmd -a pci0 -- -i --rxq=4 --txq=4'

tg:
     agent: scapy
```

Test commands do not bound to a specific setup.
Therefore, testpmd commad line and SCAPY sendp() function use encoding
to describe relative interface position in a tested HBA.

PCI encoding scheme for testpmd:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- PF PCI: `pciX`
   Example: `pci0: '0000:08:00.0'`


- PCI SR-IOV: `pciXvfY`
   Example: `pci0vf0: '0000:08:00.2'`

Network devices encoding scheme for SCAPY:
- PF: `pfX`
   Example: `pf0: enp8s0f0np0`


- PCI SR-IOV: `pfXvfY`
   Example: `pf0vf0: enp5s0f0v0`


- Network device representor: `pfXrfY`

      Example: `pf0rf0: enp5s0f0npf0vf0`


Test execution requires an additional file to describe tested setup.

Setup file format:
~~~~~~~~~~~~~~~~~

```
<application id>: # unique application ID
     host:         # hostname or IPvX address
     path:         # optional application path
     hba:          # optional HBA description
         pmd:      # PMD
         hw:       # HW type
```

Example:

```yaml
dut:
     host: 1.2.3.4
     path: /opt/dpdk.org/build/app
     hba:
         pmd: mlx5
         hw: mt4125
tg:
     host: ::1234
```

```yaml
dut:
     agent: testpmd
     cmd: 'dpdk-testpmd -a pci0 -- -i --rxq=4 --txq=4'
tg:
     agent: scapy

test:
     -
         phases: [ *ref_phase0 ]
         repeat: 1
     -
         phases: [ *ref_phase1 ]
         repeat: 3

phase_0: &ref_phase0
     name: CONFIGURATION
     tg: |
         udp_pkt = Ether()/IP()/UDP(sport=31)/Raw('== TEST ==')
         print('packet is ready')
     dut: |
         start
         set verbose 1
         flow create 0 ingress pattern eth / ipv4 / udp src is 31 / end actions queue index 1 / end
     result:
         dut: 'Flow rule #0 created'
         tg: 'packet is ready'

phase_1: &ref_phase1
     name: SEND and VALIDATE
     tg: sendp(udp_pkt, iface=pf0)
     result:
         dut: '- RSS queue=0x1 -'
```

The plain text format provides minimalistic and intuitive framework for DTS 
tests.
DTS can use plan text testpmd/scapy command format in addition to Python 
framework.

Regards,
Gregory

             reply	other threads:[~2023-12-26  7:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26  7:31 Etelson, Gregory [this message]
2024-01-08  1:55 ` Honnappa Nagarahalli
2024-01-08  6:10   ` Etelson, Gregory
2024-01-08 17:36     ` Honnappa Nagarahalli
2024-01-18 12:32       ` Juraj Linkeš
2024-01-19 20:01         ` Patrick Robb
2024-01-08 12:17   ` Luca Vizzarro
2024-01-08 17:35     ` Honnappa Nagarahalli
2024-01-08 12:10 ` Luca Vizzarro
2024-01-08 17:23   ` Etelson, Gregory
2024-01-22 17:31   ` Thomas Monjalon
2024-01-23  3:42     ` Honnappa Nagarahalli
2024-01-23  8:50       ` Thomas Monjalon
2024-01-23 18:26         ` Jeremy Spewock
2024-01-28 13:44           ` Gregory Etelson
2024-01-30 22:03             ` Patrick Robb
2024-01-31  7:42               ` Etelson, Gregory
2024-02-14 17:27                 ` Gregory Etelson
2024-02-19  5:08                   ` Patrick Robb
2024-02-20 13:35                     ` Gregory Etelson

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=2a287ee7-cda4-f2ab-a4e6-a47021f8573f@nvidia.com \
    --to=getelson@nvidia.com \
    --cc=Luca.Vizzarro@arm.com \
    --cc=Paul.Szczepanek@arm.com \
    --cc=ci@dpdk.org \
    --cc=dev@dpdk.org \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=jspewock@iol.unh.edu \
    --cc=juraj.linkes@pantheon.tech \
    --cc=probb@iol.unh.edu \
    --cc=thomas@monjalon.net \
    --cc=yoan.picchi@foss.arm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).