From: "Etelson, Gregory" <getelson@nvidia.com>
To: Patrick Robb <probb@iol.unh.edu>
Cc: "Gregory Etelson" <getelson@nvidia.com>,
"Jeremy Spewock" <jspewock@iol.unh.edu>,
"NBU-Contact-Thomas Monjalon (EXTERNAL)" <thomas@monjalon.net>,
"Honnappa Nagarahalli" <Honnappa.Nagarahalli@arm.com>,
"Juraj Linkeš" <juraj.linkes@pantheon.tech>,
"Paul Szczepanek" <Paul.Szczepanek@arm.com>,
"Yoan Picchi" <yoan.picchi@foss.arm.com>,
"Luca Vizzarro" <Luca.Vizzarro@arm.com>,
"ci@dpdk.org" <ci@dpdk.org>, "dev@dpdk.org" <dev@dpdk.org>,
nd <nd@arm.com>, "Maayan Kashani" <mkashani@nvidia.com>,
"Asaf Penso" <asafp@nvidia.com>
Subject: Re: DTS testpmd and SCAPY integration
Date: Wed, 31 Jan 2024 09:42:58 +0200 (IST) [thread overview]
Message-ID: <dbb626e2-62d3-aa2f-94bf-5ae53d3a47ed@nvidia.com> (raw)
In-Reply-To: <CAJvnSUAta_e7unw2FwwJxLQYKe9H_+hJ8Fh7x+CK2Q-wTn+JUg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4059 bytes --]
Hello Patrick,
> External email: Use caution opening links or attachments
> Thank you for sharing Gregory. I did not get an opportunity to look through the code today, but I did run
> through the presentation. A few points I noted:
> 1. The presentation shows an example testpmd testcase for creating a flow rule, and then shows a
> validation step in which standard out is compared against the expected string ("flow rule x created") and
> we can conclude whether we are able to create flow rules. Are you also sending packets according to the
> flow rules and validating that what is sent/received corresponds to the expected behavior of the flow
> rules? When I look at the old DTS framework, and an example flow rules testsuite
> (https://doc.dpdk.org/dts/test_plans/rte_flow_test_plan.html) which we want feature parity with, I think
> that validation for this testing framework needs to primarily rely on comparing packets sent and packets
> received.
The unit test infrastructure validates flow rule creation and
a result produced by that flow.
Flow result is triggered by a packet.
However, flow result validation does not always can be done by testing a packet.
Unit test implements 2 flow validation methods.
The first validation method tests testpmd output triggered by a test packet.
Example: use the MODIFY_FIELD action to copy packet VLAN ID to flow TAG item.
Flow tag is internal flow resource. It must be validated in DPDK application.
Test creates 2 flow rules:
Rule 1: use MODIFY_FILED to copy packet VLAN ID to flow TAG item
pattern eth / vlan / end \
actions modify_field op set dst_type tag ... src_type vlan_id ... / end
Rule 2: validate the TAG item:
pattern tag data is 0x31 ... / end actions mark id 0xaaa / rss / end
The test sends a packet with VLAN ID 0x31: / Dot1Q(vlan=0x31) /
The test matches tespmd output triggered by the packet for
`FDIR matched ID=0xaaa`.
The second validation method tests a packet after it was processed by a flow.
Unit test operates in a static environment. It does not compare
source and target packets. The test "knows" valid target packet configuration.
Example: push VLAN header into a packet.
There is a single flow rule in that example:
pattern eth / end \
actions of_push_vlan ethertype 0x8100 / \
of_set_vlan_vid vlan_vid 3103 .../ port_id id 1 / end
There are 2 SCAPY processes in that test: `tg` runs on peer host and
sends a source packet. `vm` runs on the same host as testpmd. It validates
incoming packet.
Phase 0 prepares test packet on the `tg` and starts AsyncSniffer on the `vm`.
Phase 1 sends the packet.
Phase 2 validates the packet.
The test can repeat phases 1 and 2.
phase0:
vm: |
sniff = AsyncSniffer(iface=pf1vf0, filter='udp and src port 1234')
tg: |
udp_packet = Ether(src='11:22:33:44:55:66',
dst='aa:bb:cc:dd:ee:aa')/
IP(src='1.1.1.1', dst='2.2.2.2')/
UDP(sport=1234, dport=5678)/Raw('== TEST ==')
phase1: &phase1
vm: sniff.start()
tg: sendp(udp_packet, iface=pf1)
phase2: &phase2
vm: |
cap = sniff.stop()
if len(cap[UDP]) > 0: cap[UDP][0][Ether].command()
result:
vm: vlan=3103
>In any case, there may be some testsuites which can be written which are small
>enough in scope
> that validating by standard out in this way may be appropriate. I'm not sure but we should keep our
> options open.
>
> 2. If the implementation overhead is not too significant for the configuration step in the DTS execution a
> "--fast" option like you use may be a good improvement for the framework. In your mind, is the main
> benefit A. reduced execution time, B. reduced user setup time (don't have to write full config file) or C.
> Something else?
A user must always provide test configuration.
However a host can already have prepared setup before the test execution.
In that case a user can skip host setup phase and reduce execution time.
>
> Thanks for making this available to use so we can use it as a reference in making DTS better. :)
>
>
next prev parent reply other threads:[~2024-01-31 7:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-26 7:31 Etelson, Gregory
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 [this message]
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=dbb626e2-62d3-aa2f-94bf-5ae53d3a47ed@nvidia.com \
--to=getelson@nvidia.com \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=Luca.Vizzarro@arm.com \
--cc=Paul.Szczepanek@arm.com \
--cc=asafp@nvidia.com \
--cc=ci@dpdk.org \
--cc=dev@dpdk.org \
--cc=jspewock@iol.unh.edu \
--cc=juraj.linkes@pantheon.tech \
--cc=mkashani@nvidia.com \
--cc=nd@arm.com \
--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).