Skip to content

Commit 2bec08f

Browse files
Merge pull request Mellanox#261 from almaslennikov/spc-x
feat: add docs for SPC-X optimizations
2 parents 40ece71 + 285285a commit 2bec08f

File tree

6 files changed

+129
-68
lines changed

6 files changed

+129
-68
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ build-cache:
171171
# Add commands to populate the cache here \
172172
export PM_PACKAGES_ROOT=${CACHE_DIR}; \
173173
${CURDIR}/repo.sh docs || true; \
174-
${CURDIR}/tools/packman/python.sh -m pip install --no-cache-dir --no-deps -U -t ${CACHE_DIR}/chk/sphinx/4.5.0.2-py3.7-linux-x86_64/ Sphinx-Substitution-Extensions; \
174+
${CURDIR}/tools/packman/python.sh -m pip install --no-cache-dir --no-deps -U -t ${CACHE_DIR}/chk/sphinx/4.5.0.2-py3.7-linux-x86_64/ Sphinx-Substitution-Extensions sphinxext-remoteliteralinclude; \
175175
fi
176176

177177
.PHONY: process-examples

docs/nic-conf-operator/nic-configuration-operator.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ NIC Configuration Operator
2626

2727
NIC Firmware Configuration <nic-fw-configuration.rst>
2828
Configuration Details <configuration-details.rst>
29+
[TECH PREVIEW] Spectrum-X Configuration <spectrum-x-configuration.rst>
2930
CRD API Reference <crds.rst>

docs/nic-conf-operator/nic-fw-configuration.rst

Lines changed: 9 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -146,22 +146,9 @@ Configure and apply the NICFirmwareSource CR
146146

147147
Deploy the NICFirmwareSource CR:
148148

149-
.. code-block:: yaml
150-
151-
apiVersion: configuration.net.nvidia.com/v1alpha1
152-
kind: NicFirmwareSource
153-
metadata:
154-
name: connectx6-dx-firmware-22-44-1036
155-
namespace: nvidia-network-operator
156-
finalizers:
157-
- configuration.net.nvidia.com/nic-configuration-operator
158-
spec:
159-
# a list of firmware binaries zip archives from the Mellanox website, can point to any URL accessible from the cluster
160-
binUrlSources:
161-
- https://www.mellanox.com/downloads/firmware/fw-ConnectX6Dx-rel-22_44_1036-MCX623106AC-CDA_Ax-UEFI-14.37.14-FlexBoot-3.7.500.signed.bin.zip
162-
# a URL to the BlueField Bundle (BFB) file, can point to any URL accessible from the cluster
163-
bfbUrlSource:
164-
- https://example.com/bf-fwbundle-3.1.0-77_25.07-prod.bfb
149+
.. rli:: https://raw.githubusercontent.com/Mellanox/nic-configuration-operator/refs/tags/network-operator-|network-operator-version|/docs/examples/example-nicfwsource-connectx6dx.yaml
150+
:language: yaml
151+
:lines: 18-
165152

166153
.. note::
167154
The ConnectX firmware binaries can be downloaded from the `NVIDIA Networking Firmware Downloads page <https://network.nvidia.com/support/firmware/firmware-downloads/>`_.
@@ -190,21 +177,9 @@ Configure and apply the NicFirmwareTemplate CR
190177

191178
Configure and apply the NicFirmwareTemplate CR:
192179

193-
.. code-block:: yaml
194-
195-
apiVersion: configuration.net.nvidia.com/v1alpha1
196-
kind: NicFirmwareTemplate
197-
metadata:
198-
name: connectx6dx-config
199-
namespace: nvidia-network-operator
200-
spec:
201-
nodeSelector:
202-
kubernetes.io/hostname: node1
203-
nicSelector:
204-
nicType: "101d"
205-
template:
206-
nicFirmwareSourceRef: connectx6dx-firmware-22-44-1036
207-
updatePolicy: Update
180+
.. rli:: https://raw.githubusercontent.com/Mellanox/nic-configuration-operator/refs/tags/network-operator-|network-operator-version|/docs/examples/example-nicfirmwaretemplate-connectx6-dx.yaml
181+
:language: yaml
182+
:lines: 18-
208183

209184
Spec of the NicDevice CR is updated in accordance with the NICFirmwareTemplate and NicConfigurationTemplate CRs matching the device
210185

@@ -267,40 +242,9 @@ Configure NIC Firmware using the NIC Configuration Operator
267242
Configure and apply the NicConfigurationTemplate CR
268243
---------------------------------------------------
269244

270-
.. code-block:: yaml
271-
272-
apiVersion: configuration.net.nvidia.com/v1alpha1
273-
kind: NicConfigurationTemplate
274-
metadata:
275-
name: connectx6-config
276-
namespace: nvidia-network-operator
277-
spec:
278-
nodeSelector:
279-
feature.node.kubernetes.io/network-sriov.capable: "true"
280-
nicSelector:
281-
# nicType selector is mandatory the rest are optional. Only a single type can be specified.
282-
nicType: 101d
283-
pciAddresses:
284-
- "0000:03:00.0"
285-
- “0000:04:00.0”
286-
serialNumbers:
287-
- "mt1952x03327"
288-
resetToDefault: false # if set, template is ignored, device configuration should reset
289-
template:
290-
# numVfs and linkType fields are mandatory, the rest are optional
291-
numVfs: 2
292-
linkType: Ethernet
293-
pciPerformanceOptimized:
294-
enabled: true
295-
maxReadRequest: 4096
296-
roceOptimized:
297-
enabled: true
298-
qos:
299-
trust: dscp
300-
pfc: "0,0,0,1,0,0,0,0"
301-
gpuDirectOptimized:
302-
enabled: true
303-
env: Baremetal
245+
.. rli:: https://raw.githubusercontent.com/Mellanox/nic-configuration-operator/refs/tags/network-operator-|network-operator-version|/docs/examples/example-nicconfigurationtemplate-connectx6dx.yaml
246+
:language: yaml
247+
:lines: 18-
304248

305249
.. note:: It's not possible to apply more than one template of each kind (NICFirmwareTemplate or NICConfigurationTemplate) to a single device. In this case, no template will be applied and an error event will be emitted for the corresponding NicDevice CR.
306250

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
.. license-header
2+
SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
SPDX-License-Identifier: Apache-2.0
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
17+
.. headings # #, * *, =, -, ^, "
18+
19+
.. include:: ../common/vars.rst
20+
21+
**************************************************
22+
[TECH PREVIEW] NVIDIA Spectrum-X NIC Configuration
23+
**************************************************
24+
25+
.. contents:: On this page
26+
:depth: 4
27+
:local:
28+
:backlinks: none
29+
30+
31+
`NVIDIA NIC Configuration Operator <https://github.com/Mellanox/nic-configuration-operator>`_ offers NVIDIA Spectrum-X-specific NIC configuration for different versions of the Reference Architecture.
32+
33+
.. note:: Currently, only ConnectX-8 (device ID 1023) and BlueField-3 SuperNIC (device ID a2dc) devices are supported for this configuration.
34+
35+
.. warning:: Tech Preview feature.
36+
37+
====================================================
38+
Install and configure the NIC Configuration Operator
39+
====================================================
40+
41+
To install the operator and for more information about the CRDs follow the `NIC FW Configuration <nic-fw-configuration.rst>`_ and `Configuration Details <configuration-details.rst>`_ doc articles.
42+
43+
=============================================
44+
Provision the DOCA SPC-X CC algorithm package
45+
=============================================
46+
47+
To enable the DOCA SPC-X CC algorithm on NIC devices, the DOCA SPC-X CC .deb package for ubuntu 22.04 is required. This configuration step will be removed in the future, once the DOCA SPC-X CC algorithm will be publicly available.
48+
To access the package, contact your NVIDIA CPM.
49+
The package should be made available in the cluster and then its URL should be provided in the packageUrlSource field of the SpectrumXOperator CR.
50+
51+
.. rli:: https://raw.githubusercontent.com/Mellanox/nic-configuration-operator/refs/tags/network-operator-|network-operator-version|/docs/examples/spectrum-x/example-nicfirmwaresource-spectrum-x-cc-only.yaml
52+
:language: yaml
53+
:lines: 18-
54+
55+
If firmware on the devices also needs to be updated, extend the NicFirmwareSource CR with fields for ConnectX and BlueField firmware. Please, use the correct firmware for your devices.
56+
57+
.. rli:: https://raw.githubusercontent.com/Mellanox/nic-configuration-operator/refs/tags/network-operator-|network-operator-version|/docs/examples/spectrum-x/example-nicfirmwaresource-spectrum-x-full.yaml
58+
:language: yaml
59+
:lines: 18-
60+
61+
Configure and apply the NicFirmwareTemplate CR:
62+
63+
.. rli:: https://raw.githubusercontent.com/Mellanox/nic-configuration-operator/refs/tags/network-operator-|network-operator-version|/docs/examples/spectrum-x/example-nicfirmwaretemplate-spectrum-x.yaml
64+
:language: yaml
65+
:lines: 18-
66+
67+
======================================
68+
Enable SPC-X optimizations for devices
69+
======================================
70+
71+
.. rli:: https://raw.githubusercontent.com/Mellanox/nic-configuration-operator/refs/tags/network-operator-|network-operator-version|/docs/examples/spectrum-x/example-nicconfigurationtemplate-spectrum-x.yaml
72+
:language: yaml
73+
:lines: 18-
74+
75+
---------------------
76+
Configuration details
77+
---------------------
78+
79+
Following configuration parameters are applied with spectrumXOptimized.enabled == true and spectrumXOptimized.version == "RA2.0":
80+
81+
.. rli:: https://raw.githubusercontent.com/Mellanox/nic-configuration-operator/refs/tags/network-operator-|network-operator-version|/bindata/spectrum-x/RA2.0.yaml
82+
:language: yaml
83+
:lines: 17-

repo.sh

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,37 @@ set -e
55
SCRIPT_DIR=$(dirname ${BASH_SOURCE})
66
cd "$SCRIPT_DIR"
77

8-
exec "tools/packman/python.sh" tools/repoman/repoman.py $@
8+
if [ "${1:-}" = "docs" ]; then
9+
echo "Processing RST files for rli:: variable substitutions..."
10+
# Forward substitutions script: |var| -> value (applies only to lines with 'rli::')
11+
sed_file_f=/tmp/vars_rli.sed
12+
grep -E '^\.\. \|.*\| replace::' docs/common/vars.rst | \
13+
sed 's/\.\. |\(.*\)| replace:: \(.*\)/\/rli::\/ s@|\1|@\2@g/' > "$sed_file_f"
14+
# Apply in-place only to matching files (those that contain rli::)
15+
grep -RIl --include="*.rst" --exclude-dir="_build" 'rli::' docs | while read -r file; do
16+
echo "Processing $file"
17+
sed -i -f "$sed_file_f" "$file"
18+
done
19+
fi
20+
21+
# Run the documentation build (do not exec so we can run post-steps)
22+
set +e
23+
"tools/packman/python.sh" tools/repoman/repoman.py "$@"
24+
rc=$?
25+
set -e
26+
27+
if [ "${1:-}" = "docs" ]; then
28+
echo "Reverting rli:: substitutions in RST files..."
29+
# Reverse substitutions script: value -> |var| (applies only to lines with 'rli::')
30+
sed_file_r=/tmp/vars_rli_rev.sed
31+
grep -E '^\.\. \|.*\| replace::' docs/common/vars.rst | \
32+
sed 's/\.\. |\(.*\)| replace:: \(.*\)/\/rli::\/ s@\2@|\1|@g/' > "$sed_file_r"
33+
grep -RIl --include="*.rst" --exclude-dir="_build" 'rli::' docs | while read -r file; do
34+
echo "Processing $file"
35+
sed -i -f "$sed_file_r" "$file"
36+
done
37+
# Cleanup both scripts if present
38+
rm -f /tmp/vars_rli.sed "$sed_file_r"
39+
fi
40+
41+
exit $rc

repo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ social_media_set = []
1313
social_media = []
1414
favicon = "${root}/assets/favicon.ico"
1515
logo = "${root}/assets/nvidia-logo-white.png"
16-
extensions_extra = ['sphinx_substitution_extensions']
16+
extensions_extra = ['sphinx_substitution_extensions', 'sphinxext.remoteliteralinclude']
1717

1818
[repo_docs.builds.linkcheck]
1919
build_by_default = false

0 commit comments

Comments
 (0)