Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmcquade/6e3fdb7bfe43a56b9868fa96566ad6c3 to your computer and use it in GitHub Desktop.
Save kmcquade/6e3fdb7bfe43a56b9868fa96566ad6c3 to your computer and use it in GitHub Desktop.
Amazon Elastic Network Adapter (ENA) on CentOS 7
sudo su
yum --enablerepo=extras install epel-release
yum -y install patch dkms kernel-devel perl
yum update
reboot
sudo su
//TODO fetch latest ena_driver from: https://github.com/amzn/amzn-drivers/releases, this script is based on 1.5.3
cd /tmp
curl -o ena_linux_1.6.0.tar.gz https://codeload.github.com/amzn/amzn-drivers/tar.gz/ena_linux_1.6.0
tar zxvf ena_linux_1.6.0.tar.gz
mv amzn-drivers-ena_linux_1.6.0 /usr/src/ena-1.6.0
cat <<EOF > /usr/src/ena-1.6.0/dkms.conf
PACKAGE_NAME="ena"
PACKAGE_VERSION="1.6.0"
AUTOINSTALL="yes"
REMAKE_INITRD="yes"
BUILT_MODULE_LOCATION[0]="kernel/linux/ena"
BUILT_MODULE_NAME[0]="ena"
DEST_MODULE_LOCATION[0]="/updates"
DEST_MODULE_NAME[0]="ena"
CLEAN="cd kernel/linux/ena; make clean"
MAKE="cd kernel/linux/ena; make BUILD_KERNEL=\${kernelver}"
EOF
dkms add -m ena -v 1.6.0
dkms build -m ena -v 1.6.0
dkms install -m ena -v 1.6.0
dracut -f --add-drivers ena
##Verification:
modinfo ena
##### You should get similar info: #####
#filename: /lib/modules/3.10.0-862.2.3.el7.x86_64/extra/ena.ko.xz
#version: 1.6.0g
#license: GPL
#description: Elastic Network Adapter (ENA)
#author: Amazon.com, Inc. or its affiliates
#retpoline: Y
#rhelversion: 7.5
#srcversion: D4B979EA6202E400E558CD0
#alias: pci:v00001D0Fd0000EC21sv*sd*bc*sc*i*
#alias: pci:v00001D0Fd0000EC20sv*sd*bc*sc*i*
#alias: pci:v00001D0Fd00001EC2sv*sd*bc*sc*i*
#alias: pci:v00001D0Fd00000EC2sv*sd*bc*sc*i*
#depends:
#vermagic: 3.10.0-862.2.3.el7.x86_64 SMP mod_unload modversions
#parm: debug:Debug level (0=none,...,16=all) (int)
#Stop the instance and from another AWS instance run:
aws ec2 modify-instance-attribute --region THE_INSTANCE_REGION --instance-id THE_INSTANCE_ID --ena-support
#e.g: aws ec2 modify-instance-attribute --region ap-southeast-1 --instance-id i-0123456789abcdef --ena-support
#Create an image from the instance
#Open the image on ENA supportive instance type (e.g. M5 , R4,.. )
#Validate interface:
ifconfig -s -a
#get Iface name, e.g: ens5
ethtool -i ens5
##### You should get similar info: #####
#driver: ena
#version: 1.6.0g
#firmware-version:
#expansion-rom-version:
#bus-info: 0000:00:05.0
#supports-statistics: yes
#supports-test: no
#supports-eeprom-access: no
#supports-register-dump: no
#supports-priv-flags: no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment