-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement firmware version check
- Loading branch information
Showing
14 changed files
with
227 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: supported-nic-firmware | ||
namespace: system | ||
data: | ||
Nvidia_mlx5_ConnectX-4: "1013 24.07-0.6.1 12.28.2006" | ||
Nvidia_mlx5_ConnectX-5: "1017 24.07-0.6.1 16.35.4030" | ||
Nvidia_mlx5_ConnectX-5_Ex: "1019 24.07-0.6.1 16.35.4030" | ||
Nvidia_mlx5_ConnectX-6: "101b 24.07-0.6.1 20.42.1000" | ||
Nvidia_mlx5_ConnectX-6_Dx: "101d 24.07-0.6.1 22.42.1000" | ||
Nvidia_mlx5_ConnectX-6_Lx: "101f 24.07-0.6.1 26.42.1000" | ||
Nvidia_mlx5_ConnectX-7: "1021 24.07-0.6.1 28.42.1000" | ||
Nvidia_mlx5_MT42822_BlueField-2_integrated_ConnectX-6_Dx: "a2d6 24.07-0.6.1 24.42.1000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
resources: | ||
- configmap.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
deployment/nic-configuration-operator-chart/templates/supported-nic-firmware-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: supported-nic-firmware | ||
data: | ||
Nvidia_mlx5_ConnectX-4: "1013 24.07-0.6.1 12.28.2006" | ||
Nvidia_mlx5_ConnectX-5: "1017 24.07-0.6.1 16.35.4030" | ||
Nvidia_mlx5_ConnectX-5_Ex: "1019 24.07-0.6.1 16.35.4030" | ||
Nvidia_mlx5_ConnectX-6: "101b 24.07-0.6.1 20.42.1000" | ||
Nvidia_mlx5_ConnectX-6_Dx: "101d 24.07-0.6.1 22.42.1000" | ||
Nvidia_mlx5_ConnectX-6_Lx: "101f 24.07-0.6.1 26.42.1000" | ||
Nvidia_mlx5_ConnectX-7: "1021 24.07-0.6.1 28.42.1000" | ||
Nvidia_mlx5_MT42822_BlueField-2_integrated_ConnectX-6_Dx: "a2d6 24.07-0.6.1 24.42.1000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
2024 NVIDIA CORPORATION & AFFILIATES | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package helper | ||
|
||
import ( | ||
"context" | ||
"strings" | ||
|
||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/client-go/kubernetes" | ||
"sigs.k8s.io/controller-runtime/pkg/log" | ||
|
||
"github.com/Mellanox/nic-configuration-operator/pkg/consts" | ||
) | ||
|
||
// NicFirmwareMap contains supported mapping of NIC firmware with each in the format of: | ||
// NIC ID, Firmware version | ||
var NicFirmwareMap = []string{} | ||
|
||
func InitNicFwMapFromConfigMap(client kubernetes.Interface, namespace string) error { | ||
cm, err := client.CoreV1().ConfigMaps(namespace).Get( | ||
context.Background(), | ||
consts.SupportedNicFirmwareConfigmap, | ||
metav1.GetOptions{}, | ||
) | ||
// if the configmap does not exist, return false | ||
if err != nil { | ||
return err | ||
} | ||
for _, v := range cm.Data { | ||
NicFirmwareMap = append(NicFirmwareMap, v) | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func GetRecommendedFwVersion(deviceId, ofed string) string { | ||
for _, n := range NicFirmwareMap { | ||
fw := strings.Split(n, " ") | ||
if len(fw) < 3 { | ||
log.Log.Info("incorrect NicFirmwareMap value", "fw", fw) | ||
return "" | ||
} | ||
if deviceId == fw[0] && ofed == fw[1] { | ||
return fw[2] | ||
} | ||
} | ||
return "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters