Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc for trex & testpmd #660

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions test/yaml/testpmd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Usage
=====

Deploy the yaml

```shell
kubectl create namespace testpmd
kubectl apply -f test.yaml
```

Start testpmd (4-6 being the CPU range on which to run testpmd)
```shell
kubectl -n testpmd exec -it testpmd memif-testpmd 4-6
```

The annotation in the yaml specification of the pod specifies that
packets to the PodIP destined to ports between 4444 and 20000 for
both TCP and UDP will be sent to the memif, and end up in testpmd.
```yaml
annotations:
"cni.projectcalico.org/vppExtraMemifPorts": "tcp:4444-20000,udp:4444-20000"
```

Testpmd is started in 5tuple swap mode, meaning it will mirror all the packets
it receives. In order to test it, either send a single TCP packet, e.g.
`curl http://<testPmdPodIP>:4444` from another container or a cluster node.

Alternatively you can also use a traffic generator like trex (see the corresponding
yaml under [../trex](../trex))




2 changes: 1 addition & 1 deletion test/yaml/testpmd/memif-testpmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ testpmd --iova-mode=va \
--in-memory \
--no-pci \
--proc-type primary \
--vdev=net_memif,role=client,socket=vpp/memif,socket-abstract=yes,zero-copy=no \
--vdev=net_memif,role=client,socket=vpp/memif-eth0,socket-abstract=yes,zero-copy=no \
-- --auto-start \
--forward-mode=5tswap \
--burst=32 \
Expand Down
2 changes: 1 addition & 1 deletion test/yaml/testpmd/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
name: testpmd
namespace: testpmd
annotations:
"cni.projectcalico.org/vppExtraMemifPorts": "tcp:4444-20000,udp:4444-20000"
"cni.projectcalico.org/vppExtraMemifPorts": "tcp:4444-20000,udp:4444-20000"
spec:
containers:
- name: testpmd
Expand Down
2 changes: 1 addition & 1 deletion test/yaml/trex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Usage
Deploy the yaml

```
kubectl add ns trex
kubectl create namespace trex
kubectl apply -f test.yaml
```

Expand Down
4 changes: 2 additions & 2 deletions test/yaml/trex/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ spec:
- containerPort: 4444
resources:
limits:
memory: 2Gi
hugepages-2Mi: 2Gi
memory: 1Gi
hugepages-2Mi: 1Gi
volumeMounts:
- mountPath: /hugepages
name: hugepage
Expand Down
2 changes: 1 addition & 1 deletion test/yaml/trex/trex-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function generate_trex_conf () {
echo "---
- port_limit: 2
version: 2
interfaces: ['--vdev=net_memif,role=client,socket=vpp/memif,socket-abstract=yes,zero-copy=no', 'dummy']
interfaces: ['--vdev=net_memif,role=client,socket=vpp/memif-eth0,socket-abstract=yes,zero-copy=no', 'dummy']
c: 4
port_info:
- dest_mac: 02:00:00:00:00:02
Expand Down