All Projects → Mellanox → sriovnet

Mellanox / sriovnet

Licence: Apache-2.0 license
Go library/package to configure SRIOV networking devices

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Labels

Projects that are alternatives of or similar to sriovnet

sriov
Simple standalone Docker Plugin implementation to demonstrate Clear Containers with SRIOV
Stars: ✭ 25 (-3.85%)
Mutual labels:  sriov
sriov-cni
DPDK & SR-IOV CNI plugin
Stars: ✭ 209 (+703.85%)
Mutual labels:  sriov
k8s-rdma-sriov-dev-plugin
Kubernetes Rdma SRIOV device plugin
Stars: ✭ 92 (+253.85%)
Mutual labels:  sriov
docker-sriov-plugin
Docker networking plugin for SRIOV and passthrough interfaces
Stars: ✭ 70 (+169.23%)
Mutual labels:  sriov

License Go Report Card Build Test Coverage Status

sriovnet

Go library to configure SRIOV networking devices

Local build and test

You can use go get command:

go get github.com/k8snetworkplumbingwg/sriovnet

Example:

package main

import (
    "fmt"

    "github.com/k8snetworkplumbingwg/sriovnet"
)

func main() {
	var vfList[10] *sriovnet.VfObj

	err1 := sriovnet.EnableSriov("ib0")
	if err1 != nil {
		return
	}

	handle, err2 := sriovnet.GetPfNetdevHandle("ib0")
	if err2 != nil {
		return
	}
	err3 := sriovnet.ConfigVfs(handle, false)
	if err3 != nil {
		return
	}
	for i := 0; i < 10; i++ {
		vfList[i], _ = sriovnet.AllocateVf(handle)
	}
	for _, vf := range handle.List {
		fmt.Printf("after allocation vf = %v\n", vf)
	}
	for i := 0; i < 10; i++ {
		if vfList[i] == nil {
			continue
		}
		sriovnet.FreeVf(handle, vfList[i])
	}
	for _, vf := range handle.List {
		fmt.Printf("after free vf = %v\n", vf)
	}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].