Giter Site home page Giter Site logo

estonfer / sriov-network-device-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from k8snetworkplumbingwg/sriov-network-device-plugin

0.0 0.0 0.0 63.85 MB

SRIOV network device plugin for Kubernetes

License: Apache License 2.0

Shell 19.05% Go 79.81% Dockerfile 1.14%

sriov-network-device-plugin's Introduction

SR-IOV CNI plugin

This repository contains the sriov CNI plugin that allows DPDK driver binding as well as the orginal featuers of sriov-cni. To learn about CNI please visit containernetworking/cni.

NIC with SR-IOV capabilities works by introducing the idea of physical functions (PFs) and virtual functions (VFs).

PF is used by host. Each VFs can be treated as a separate physical NIC and assigned to one container, and configured with separate MAC, VLAN and IP, etc.

Build

This plugin requires Go 1.5+ to build.

Go 1.5 users will need to set GO15VENDOREXPERIMENT=1 to get vendored dependencies. This flag is set by default in 1.6.

#./build

Upon successful build the plugin binary will be available in bin/sriov.

Enable SR-IOV

Given Intel ixgbe NIC on CentOS, Fedora or RHEL:

# vi /etc/modprobe.conf
options ixgbe max_vfs=8,8

Configuration reference

Main parameters

  • name (string, required): the name of the network
  • type (string, required): "sriov"
  • if0 (string, required): name of the PF
  • if0name (string, optional): interface name in the Container
  • l2enable (boolean, optional): if true then add VF as L2 mode only, IPAM will not be executed
  • vlan (int, optional): VLAN ID to assign for the VF
  • ipam (dictionary, optional): IPAM configuration to be used for this network.
  • dpdk (dictionary, optional): DPDK configuration

Using DPDK drivers:

If this plugin is use to bind a VF to dpdk driver then the IPAM configtuations will be ignored.

DPDK parameters

If given, The DPDK configuration expected to have the following parameters

  • kernel_driver (string, required): kernel driver name
  • dpdk_driver (string, required): DPDK capable driver name
  • dpdk_tool (string, required): path to the dpdk-devbind.py script

Usage

Configuration with IPAM:

# cat > /etc/cni/net.d/10-mynet.conf <<EOF
{
    "name": "mynet",
    "type": "sriov",
    "if0": "enp1s0f1",
    "ipam": {
        "type": "host-local",
        "subnet": "10.55.206.0/26",
        "routes": [
            { "dst": "0.0.0.0/0" }
        ],
        "gateway": "10.55.206.1"
    }
}
EOF
eth0      Link encap:Ethernet  HWaddr 66:D8:02:77:AA:AA  
          inet addr:10.55.206.46  Bcast:0.0.0.0  Mask:255.255.255.192
          inet6 addr: fe80::64d8:2ff:fe77:aaaa/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:530 (530.0 b)  TX bytes:988 (988.0 b)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Configuration with DPDK:

# cat > /etc/cni/net.d/20-mynet-dpdk.conf <<EOF
{
    "name": "mynet",
    "type": "sriov",
    "if0": "enp1s0f1",
    "if0name": "net0",
    "dpdk": {
        "kernel_driver":"ixgbevf",
        "dpdk_driver":"igb_uio",
        "dpdk_tool":"/opt/dpdk/usertools/dpdk-devbind.py"
    }
}
EOF

More info.

Contacts

For any questions about Multus CNI, please reach out on github issue or feel free to contact the developers @kural OR @ahalim in our Intel-Corp Slack

sriov-network-device-plugin's People

Contributors

ahalimx86 avatar booxter avatar hustcat avatar jellonek avatar rkamudhan avatar zshi-redhat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.