Skip to content

Commit b834ef8

Browse files
committed
example-cnf | Document other SRIOV setups and enable privileged mode
1 parent 789a4ab commit b834ef8

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

roles/example_cnf_deploy/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ Also, exported `kubeconfig` file is required to run the Ansible tasks on the tar
4545
| ecd_networks_cnfapp | [] | no | Networks for CNFApp, including MAC addresses and (if provided) IP addresses |
4646
| ecd_networks_trex | [] | no | Networks for TRex, including MAC addresses and (if provided) IP addresses |
4747
| ecd_run_deployment | 1 | no | Run all deployment automation. If different than 1, the automation will only create the pods and prepare the scripts to launch testpmd/grout and trex manually afterwards |
48+
| ecd_enable_privileged_mode | false | no | Enable container privileged mode, instead of setting specific capabilities. This is required when using Mellanox cards. As it uses netdevice instead of vfio-pci, it requires access to /dev/vfio/vfio from host. Using a volume with hostPath is not enough to achieve it (see [this](https://access.redhat.com/solutions/6560521) for an example). |
49+
4850
| ecd_termination_grace_period_seconds | 30 | no | Termination grace period for TestPMD |
4951
| ecd_testpmd_reduced_mode | 0 | no | Use reduced mode for TestPMD (if different than 0), where only three cores are used, and txd/rxd parameters are doubled |
5052
| ecd_trex_test_config | [] | no | TRex test configuration. See an example below |
@@ -112,6 +114,10 @@ to:
112114
capabilities: '{"mac": true}'
113115
```
114116
117+
This configuration is related to Intel cards. If you are using other type of cards, you need to apply the corresponding modifications (`device_id` and `vendor` will change, among others). For example, [for Mellanox cards](https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/networking/hardware-networks#example-vf-use-in-dpdk-mode-mellanox_using-dpdk-and-rdma), you need to use `netdevice` instead of `vfio-pci`, and also enable RDMA (`is_rdma: true`).
118+
119+
> Remember that Mellanox requires containers to run in privileged mode. Enable it with `ecd_enable_privileged_mode: true`.
120+
115121
## Network configuration
116122

117123
To apply a proper network configuration for both CNFApp and TRex, you need to follow a YAML structure like this, to be provided in a file pointed by `ecd_network_config_file` (e.g. `/path/to/net-config.yml`). This is just required when using Grout, since TestPMD acts in MAC forwarding mode, so no IP addresses are required for it (but you can define them anyway, only thing is that they're not going to be considered for traffic forwarding):

roles/example_cnf_deploy/defaults/main.yml

+6
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ ecd_networks_trex: []
6767
# to launch testpmd/grout and trex manually afterwards
6868
ecd_run_deployment: 1
6969

70+
# Enable container privileged mode, instead of setting specific capabilities.
71+
# This is required when using Mellanox cards. As it uses netdevice instead of vfio-pci,
72+
# it requires access to /dev/vfio/vfio from host. Using a volume with hostPath is not
73+
# enough to achieve it (see https://access.redhat.com/solutions/6560521 for an example).
74+
ecd_enable_privileged_mode: false
75+
7076
# RuntimeClass that should be used for running DPDK application,
7177
# if the var is empty, the annotation irq-load-balancing.crio.io: "disable" is not applied
7278
# ecd_high_perf_runtime: "performance-blueprint-profile"

roles/example_cnf_deploy/templates/grout-cr.yaml.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: grout
55
namespace: {{ ecd_cnf_namespace }}
66
spec:
7-
privileged: false
7+
privileged: {{ ecd_enable_privileged_mode }}
88
imagePullPolicy: {{ ecd_image_pull_policy }}
99
size: 1
1010
networks: {{ ecd_networks_cnfapp }}

roles/example_cnf_deploy/templates/testpmd-cr.yaml.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: testpmd
55
namespace: {{ ecd_cnf_namespace }}
66
spec:
7-
privileged: false
7+
privileged: {{ ecd_enable_privileged_mode }}
88
imagePullPolicy: {{ ecd_image_pull_policy }}
99
ethpeerMaclist: {{ ecd_trex_mac_list }}
1010
size: 1

roles/example_cnf_deploy/templates/trex-server-cr.yaml.j2

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ spec:
1616
imagePullPolicy: {{ ecd_image_pull_policy }}
1717
networks: {{ ecd_networks_trex }}
1818
cpu: 6
19+
privileged: {{ ecd_enable_privileged_mode }}
1920
runDeployment: {{ ecd_run_deployment }}
2021
{% if ecd_trex_config_skip|default(false)|bool %}
2122
trex_config_skip: true

0 commit comments

Comments
 (0)