Skip to content
forked from gomesjj/r8152

USB NIC Driver for ESXi 5.1/5.5/6.0/6.5/6.7 based on the Realtek r8152 source code

Notifications You must be signed in to change notification settings

acjohnson/r8152

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

USB NIC Driver for ESXi 5.1/5.5/6.0/6.5/6.7 (Realtek)

Realtek r8152 driver for ESXi

**Update (12/02/19)**
  • Modules compiled for ESXi 6.5 will work on ESXi 6.7 without modification
  • Source code updated to version 2.11.0 (latest)
  • Version 2.11.0 adds support for the upcoming 2.5G USB C Ethernet adapters (RTL8156)
  • Build script for ESXi 6.5 added
  • Key features:

    • Supports Realtek RTL8153 and RTL8152
    • TCP, UDP and IPv4 checksum offload (RX and TX)
    • TCP, UDP and IPv6 checksum offload (RX and TX)
    • Scatter-Gather support
    • TCP Segmentation Offload support
    • Wake on LAN support
    • VLAN support
    • Jumbo Frames (9k)
    • Energy Efficient Ethernet (EEE)

    Known issues

    • Unloading the module manually is not supported
      • The following message appears on vmkernel.log:
        Failed to close vmnic32: not ready. Flags 0x1140

    This message can be safely ignored, however, if the module is reloaded, the vmnic number will change

    ###Table of Contents

    Tested Devices

    Tested by Glen Kemp

    USB 2.0 Adapter (RTL8152B Chipset)

    Tested by Glen Kemp

    Required Software

    CentOS 5.3-x86 64 bit DVD ISO - http://mirror.ash.fastserv.com/centos/5.3/isos/x86_64/CentOS-5.3-x86_64-bin-DVD.iso

    ESXi 6.0 and 6.5

    VMware ESXi 6.0 source code (VMware-ESXI-60U2-ODP.iso) and build toolchain (VMware-TOOLCHAIN-ODP-vsphere60u2-Mar-01-2016.iso)

    ESXi 5.5

    VMware ESXi 5.5 source code (VMware-ESX-5.5.0u03-ODP.iso) and build toolchain (VMware-550u3-TOOLCHAIN-ODP_21_July_2015.iso)

    ESXi 5.1

    VMware ESXi 5.1 source code and build toolchain are both included in a single file (VMware-esx-open-source-5.1.0u2.oss.tar).

    Setup

    The embedded documentation for the ESXi open source disclosure packages recommends the build should be performed on a CentOS 5.3 x64 system to produce 64-bit packages. There are other systems mentioned (CentOS 32-bit, Red Hat, FreeBSD and Windows), so take your pick!

    To make life easier, I customised the Kickstart file provided with the ESXi 5.5 Toolchain ISO (under the config folder) to build a CentOS 5.3 x64 server VM. Once it is up and running, we deviate a bit from the instructions provided by VMware.

    The initial build directory structure should be:

    mkdir -p /build/{vsphere,toolchain}

    The next steps are a bit different, depending on whether the build environment is being prepared for ESXi 5.1 or later versions:

    Prepare the build environment

    ESXi 5.1

    Extract the contents of the compressed tar archive to /build/vsphere:

    cd /build/vsphere
    tar xvf /path/to/VMware-esx-open-source-5.1.0u2.oss.tar --strip-components=1 server/vmkdrivers-gpl
    cd vmkdrivers-gpl

    You are now ready to compile the build toolchain:

    glibc

    cd glibc-2.3.2-95.44
    bash ./BUILD.txt
    cd ..

    binutils

    cd binutils-2.17.50.0.15-modcall
    bash ./BUILD.txt
    cd ..

    gcc

    cd gcc-4.1.2-9
    bash ./BUILD.txt
    cd ..		

    Unlike ESXi 5.1, the ODP source code and the build toolchain for 5.5 and 6.0 are distributed as two separate ISO images. The two ISOs include hundreds of packages, but only a small subset is actually required to build the drivers.

    ESXi 5.5

    Copy the vmkdrivers-gpl folder from the ODP ISO (VMware-ESX-5.5.0u03-ODP.iso) to /build/vsphere/

    cp -r /cdrom/vmkdrivers-gpl /build/vsphere
    umount /cdrom

    Note: The above assumes that /cdrom is the mount point for the ISO/Physical DVD — your environment might differ.

    The toolchain ISO (VMware-550u3-TOOLCHAIN-ODP_21_July_2015.iso) includes the source for multiple libraries and tools, but only glibc, binutils and gcc at specific versions are required.

    cd /build/toolchain
    tar xvf /cdrom/tc-src.tar src/gcc-4.4.3-2 src/glibc-2.3.2-95.44 src/binutils-2.20.1-1 src/common/functions
    umount /cdrom

    Note: The above assumes that /cdrom is the mount point for the ISO/Physical DVD — your environment might differ.

    Compile the build toolchain:

    glibc

    cd /build/toolchain/src/glibc-2.3.2-95.44
    bash ./install.sh

    binutils

    cd /build/toolchain/src/binutils-2.20.1-1
    bash ./install.sh

    gcc

    cd /build/toolchain/src/gcc-4.4.3-2
    bash ./install.sh

    ESXi 6.0

    Copy the vmkdrivers-gpl folder from the ODP ISO (VMware-ESXI-60U2-ODP.iso) to /build/vsphere/

    cp -r /cdrom/vmkdrivers-gpl /build/vsphere
    umount /cdrom

    Note: The above assumes that /cdrom is the mount point for the ISO/Physical DVD — your environment might differ.

    The toolchain ISO (VMware-TOOLCHAIN-ODP-vsphere60u2-Mar-01-2016.iso) includes the source for multiple libraries and tools, but only glibc, binutils and gcc at specific versions are required.

    cd /build/toolchain
    tar xvf /cdrom/tc-src.tar src/gcc-4.4.3-2 src/glibc-2.3.2-95.44 src/binutils-2.22 src/common/functions
    umount /cdrom

    Note: The above assumes that /cdrom is the mount point for the ISO/Physical DVD — your environment might differ.

    Compile the build toolchain:

    glibc

    cd /build/toolchain/src/glibc-2.3.2-95.44
    bash ./install.sh

    binutils

    cd /build/toolchain/src/binutils-2.22
    bash ./install.sh

    gcc

    cd /build/toolchain/src/gcc-4.4.3-2
    bash ./install.sh

    ESXi 6.5

    The ODB source and toolchain for 6.5 are completely broken and won't produce a working driver. However, there are no differences between the 6.0 and 6.5 source files, as VMware is preparing to drop support for legacy drivers.

    Please follow the instructions as if compiling for ESXi 6.0, noting the changes highlighted in the sections below.

    Building the driver

    There is a little bit more preparation to be done to build the driver. Again, some of the steps are different depending on the version of ESXi.

    Common

    cd /build/vsphere/vmkdrivers-gpl
    tar zxvf vmkdrivers-gpl.tgz

    Create the directory for the driver's source code. The same source files are used to build the driver on all environments.

    cd /build/vsphere/vmkdrivers-gpl
    mkdir vmkdrivers/src_92/drivers/usb/net/r8152-2.06.0
    cp /path/to/source/r8152.c vmkdrivers/src_92/drivers/usb/net/r8152-2.06.0/
    cp /path/to/source/compatibility.h vmkdrivers/src_92/drivers/usb/net/r8152-2.06.0/

    Create the directory that will hold the driver's namespace dependencies map:

    ESXi 5.1

    cd /build/vsphere/vmkdrivers-gpl
    mkdir BLD/build/HEADERS/CUR-92-vmkdrivers-namespace/vmkernel64/release/r8152-2.06.0
    echo -e "VMK_NAMESPACE_REQUIRED(\"com.vmware.usb\", \"9.2.1.0\");\
    \nVMK_NAMESPACE_REQUIRED(\"com.vmware.usbnet\", \"9.2.1.0\");"\
    > BLD/build/HEADERS/CUR-92-vmkdrivers-namespace/vmkernel64/release/r8152-2.06.0/__namespace.h

    ESXi 5.5

    cd /build/vsphere/vmkdrivers-gpl
    mkdir BLD/build/HEADERS/CUR-92-vmkdrivers-namespace/vmkernel64/release/r8152-2.06.0
    echo -e "VMK_NAMESPACE_REQUIRED(\"com.vmware.usb\", \"9.2.2.0\");\
    \nVMK_NAMESPACE_REQUIRED(\"com.vmware.usbnet\", \"9.2.2.0\");"\
    > BLD/build/HEADERS/CUR-92-vmkdrivers-namespace/vmkernel64/release/r8152-2.06.0/__namespace.h

    ESXi 6.0

    cd /build/vsphere/vmkdrivers-gpl
    mkdir BLD/build/HEADERS/92-vmkdrivers-namespace/vmkernel64/release/r8152-2.06.0
    echo -e "VMK_NAMESPACE_REQUIRED(\"com.vmware.usb\", \"9.2.3.0\");\
    \nVMK_NAMESPACE_REQUIRED(\"com.vmware.usbnet\", \"9.2.3.0\");"\
    > BLD/build/HEADERS/92-vmkdrivers-namespace/vmkernel64/release/r8152-2.06.0/__namespace.h

    ESXi 6.5

    cd /build/vsphere/vmkdrivers-gpl
    mkdir BLD/build/HEADERS/92-vmkdrivers-namespace/vmkernel64/release/r8152-2.06.0
    echo -e "VMK_NAMESPACE_REQUIRED(\"com.vmware.usb\", \"10.0\");\
    \nVMK_NAMESPACE_REQUIRED(\"com.vmware.usbnet\", \"9.2.3.0\");"\
    > BLD/build/HEADERS/92-vmkdrivers-namespace/vmkernel64/release/r8152-2.06.0/__namespace.h

    Finally, copy the appropriate build script to /build/vsphere/vmkdrivers-gpl and compile the driver.

    ESXi 5.1

    cd /build/vsphere/vmkdrivers-gpl
    cp /path/to/scripts/build-r8152-2.06.0_u51.sh .
    chmod a+x build-r8152-2.06.0_u51.sh
    ./build-r8152-2.06.0_u51.sh

    ESXi 5.5

    cd /build/vsphere/vmkdrivers-gpl
    cp /path/to/scripts/build-r8152-2.06.0_u55.sh .
    chmod a+x build-r8152-2.06.0_u55.sh
    ./build-r8152-2.06.0_u55.sh

    ESXi 6.0 and 6.5

    cd /build/vsphere/vmkdrivers-gpl
    cp /path/to/scripts/build-r8152-2.06.0_u60.sh .
    chmod a+x build-r8152-2.06.0_u60.sh
    ./build-r8152-2.06.0_u60.sh

    About

    USB NIC Driver for ESXi 5.1/5.5/6.0/6.5/6.7 based on the Realtek r8152 source code

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages

    • C 96.3%
    • Shell 3.7%