Skip to content

Commit 29c65fd

Browse files
committed
feat: Go SRIOV backup VFs
Signed-off-by: Fred Rolland <[email protected]>
1 parent 0d5ca7f commit 29c65fd

File tree

12 files changed

+2736
-7
lines changed

12 files changed

+2736
-7
lines changed

Golang_Ubuntu_Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ ARG D_OFED_URL_PATH="${D_OFED_BASE_URL}/${D_OFED_SRC_ARCHIVE}" # although argum
8080
ENV NVIDIA_NIC_DRIVER_PATH="${D_OFED_SRC_DOWNLOAD_PATH}/MLNX_OFED_SRC-${D_OFED_VERSION}"
8181

8282
WORKDIR /root
83+
RUN set -x && \
84+
apt-get update
8385
RUN set -x && \
8486
echo $D_OS | grep "ubuntu20.04" || GCC_VER="-12" && \
8587
# Install prerequirements \

entrypoint/go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ go 1.24.0
55
require (
66
github.com/go-logr/logr v1.4.3
77
github.com/gofrs/flock v0.12.1
8+
github.com/k8snetworkplumbingwg/sriovnet v1.2.0
89
github.com/stretchr/testify v1.11.1
10+
github.com/vishvananda/netlink v1.2.1-beta.2
911
go.uber.org/zap v1.27.0
1012
)
1113

@@ -15,9 +17,12 @@ require (
1517
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
1618
github.com/google/go-cmp v0.7.0 // indirect
1719
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
20+
github.com/google/uuid v1.1.2 // indirect
1821
github.com/pmezard/go-difflib v1.0.0 // indirect
1922
github.com/rogpeppe/go-internal v1.13.1 // indirect
23+
github.com/spf13/afero v1.9.4 // indirect
2024
github.com/stretchr/objx v0.5.2 // indirect
25+
github.com/vishvananda/netns v0.0.4 // indirect
2126
go.uber.org/automaxprocs v1.6.0 // indirect
2227
go.uber.org/multierr v1.10.0 // indirect
2328
go.yaml.in/yaml/v3 v3.0.4 // indirect

entrypoint/go.sum

Lines changed: 440 additions & 0 deletions
Large diffs are not rendered by default.

entrypoint/internal/entrypoint/entrypoint.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import (
2929
"github.com/Mellanox/doca-driver-build/entrypoint/internal/constants"
3030
"github.com/Mellanox/doca-driver-build/entrypoint/internal/driver"
3131
"github.com/Mellanox/doca-driver-build/entrypoint/internal/netconfig"
32+
"github.com/Mellanox/doca-driver-build/entrypoint/internal/netconfig/netlink"
33+
"github.com/Mellanox/doca-driver-build/entrypoint/internal/netconfig/sriovnet"
3234
"github.com/Mellanox/doca-driver-build/entrypoint/internal/utils/cmd"
3335
"github.com/Mellanox/doca-driver-build/entrypoint/internal/utils/host"
3436
"github.com/Mellanox/doca-driver-build/entrypoint/internal/utils/ready"
@@ -56,7 +58,7 @@ func Run(signalCh chan os.Signal, log logr.Logger, containerMode string, cfg con
5658
host: hostHelper,
5759
cmd: cmdHelper,
5860
os: osWrapper,
59-
netconfig: netconfig.New(),
61+
netconfig: netconfig.New(cmdHelper, osWrapper, hostHelper, sriovnet.New(), netlink.New()),
6062
drivermgr: driver.New(containerMode, cfg, cmdHelper, hostHelper, osWrapper),
6163
}
6264
return m.run(signalCh)

0 commit comments

Comments
 (0)