Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EC2 Enhanced networking support for official AMIs #15956

Closed
danbst opened this issue Jun 3, 2016 · 2 comments
Closed

EC2 Enhanced networking support for official AMIs #15956

danbst opened this issue Jun 3, 2016 · 2 comments
Assignees
Milestone

Comments

@danbst
Copy link
Contributor

danbst commented Jun 3, 2016

I found a disappointing issue with NixOS on AWS EC2 - absence of support for Enhanced Networking (SRI/OV) out of box.

See docs at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html

Here are separate issues:

  1. ixgbevf is outdated on 16.03 (less then recommended 2.14). Amazon Linux AMI is better then NixOS here
  2. HVM amis are built without --sriov flag. Because of 1) this makes starting spot instances with --sriov trickier

As I'm not an expert in AMI creating, instance management or kernel module packaging, I won't do pull requests on this topic. But I'd like to share some success with others.

Here is the ixgbevf-3.1.2 kernel module package. Docs say it

supports kernel versions 2.6.18 up through 4.3.3

        ixgbevf = { stdenv, fetchurl, kernel }: stdenv.mkDerivation rec {
          basename = "ixgbevf-${version}";
          name = "${basename}-${kernel.version}";
          version = "3.1.2";

          src = fetchurl {
            url = "mirror://sourceforge/e1000/ixgbevf%20stable/${version}/${basename}.tar.gz";
            sha256 = "1vkrxbp9r3rw1q4ar26gny14swl0wlznvpvbbqdlkk2sdahkfpw4";
          };

          buildInputs = [ pkgs.xz ];

          kernelVersion = kernel.modDirVersion;

          preBuild = ''
            cd src
            substituteInPlace Makefile \
              --replace "\$(shell uname -r)" "$kernelVersion" \
              --replace "/lib/modules" "${kernel.dev}/lib/modules"
          '';
          installPhase = ''
            xz ixgbevf.ko 
            install -m444 -Dt $out/lib/modules/$kernelVersion/kernel/drivers/net/ethernet/intel/ixgbevf ixgbevf.ko.xz 
          '';
          meta.priority = 1;             # we want this to replace stock ixgbevf.ko.xz
        };

And here is extract from config to enable this module:

          boot.extraModulePackages = [ (ixgbevf { inherit (pkgs) stdenv fetchurl; kernel = pkgs.linuxPackages.kernel; }) ];
          boot.initrd.kernelModules = [ "ixgbevf" ];

My instance started and ssh works. Now I have this:

# ethtool -i eth0
driver: ixgbevf
version: 3.1.2
firmware-version: N/A
expansion-rom-version:
bus-info: 0000:00:03.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no

Ping @edolstra

@edolstra
Copy link
Member

edolstra commented Jun 3, 2016

Thanks, I wasn't aware of Enhanced Networking. I'll look into it.

@edolstra edolstra self-assigned this Jun 3, 2016
@edolstra edolstra added this to the 16.09 milestone Jun 3, 2016
@edolstra
Copy link
Member

edolstra commented Jul 7, 2016

Added the driver to the Amazon config: 04eb749, 3adb769. Will need to rebuild the AMIs though (and make NixOps enable Enhanced Networking automatically), and add the ena driver for x1 instances.

edolstra added a commit that referenced this issue Jul 13, 2016
Fixes #15956.

(cherry picked from commit 02db7d9)
adrianpk added a commit to adrianpk/nixpkgs that referenced this issue May 31, 2024
Fixes NixOS#15956.

(cherry picked from commit 02db7d9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants