Giter Club home page Giter Club logo

Comments (3)

aidansteele avatar aidansteele commented on August 25, 2024 1

Some more details: I logged the PCI devices discovered in both qemu and ec2.

PCI devices in qemu
[pci] found devices: ([]*pci.Device) (len=6 cap=8) {
 (*pci.Device)(0x68024560)({
  Ident: (pci.Identity) {
   Vendor: (uint16) 32902,
   Device: (uint16) 4663
  },
  Addr: (pci.Address) {
   Bus: (uint8) 0,
   Device: (uint8) 0,
   Func: (uint8) 0
  },
  Class: (uint8) 6,
  SubClass: (uint8) 0,
  IRQLine: (uint8) 0,
  IRQNO: (uint8) 32
 }),
 (*pci.Device)(0x68024570)({
  Ident: (pci.Identity) {
   Vendor: (uint16) 32902,
   Device: (uint16) 28672
  },
  Addr: (pci.Address) {
   Bus: (uint8) 0,
   Device: (uint8) 1,
   Func: (uint8) 0
  },
  Class: (uint8) 6,
  SubClass: (uint8) 1,
  IRQLine: (uint8) 0,
  IRQNO: (uint8) 32
 }),
 (*pci.Device)(0x68024580)({
  Ident: (pci.Identity) {
   Vendor: (uint16) 32902,
   Device: (uint16) 28688
  },
  Addr: (pci.Address) {
   Bus: (uint8) 0,
   Device: (uint8) 1,
   Func: (uint8) 1
  },
  Class: (uint8) 1,
  SubClass: (uint8) 1,
  IRQLine: (uint8) 0,
  IRQNO: (uint8) 32
 }),
 (*pci.Device)(0x68024590)({
  Ident: (pci.Identity) {
   Vendor: (uint16) 32902,
   Device: (uint16) 28947
  },
  Addr: (pci.Address) {
   Bus: (uint8) 0,
   Device: (uint8) 1,
   Func: (uint8) 3
  },
  Class: (uint8) 6,
  SubClass: (uint8) 128,
  IRQLine: (uint8) 9,
  IRQNO: (uint8) 41
 }),
 (*pci.Device)(0x680245a0)({
  Ident: (pci.Identity) {
   Vendor: (uint16) 4660,
   Device: (uint16) 4369
  },
  Addr: (pci.Address) {
   Bus: (uint8) 0,
   Device: (uint8) 2,
   Func: (uint8) 0
  },
  Class: (uint8) 3,
  SubClass: (uint8) 0,
  IRQLine: (uint8) 0,
  IRQNO: (uint8) 32
 }),
 (*pci.Device)(0x680245b0)({
  Ident: (pci.Identity) {
   Vendor: (uint16) 32902,
   Device: (uint16) 4110
  },
  Addr: (pci.Address) {
   Bus: (uint8) 0,
   Device: (uint8) 3,
   Func: (uint8) 0
  },
  Class: (uint8) 2,
  SubClass: (uint8) 0,
  IRQLine: (uint8) 11,
  IRQNO: (uint8) 43
 })
}
PCI devices in EC2
[pci] found devices: ([]*pci.Device) (len=6 cap=8) {
 (*pci.Device)(0x68024554)({
  Ident: (pci.Identity) {
   Vendor: (uint16) 32902,
   Device: (uint16) 4663
  },
  Addr: (pci.Address) {
   Bus: (uint8) 0,
   Device: (uint8) 0,
   Func: (uint8) 0
  },
  Class: (uint8) 6,
  SubClass: (uint8) 0,
  IRQLine: (uint8) 0,
  IRQNO: (uint8) 32
 }),
 (*pci.Device)(0x68024560)({
  Ident: (pci.Identity) {
   Vendor: (uint16) 32902,
   Device: (uint16) 28672
  },
  Addr: (pci.Address) {
   Bus: (uint8) 0,
   Device: (uint8) 1,
   Func: (uint8) 0
  },
  Class: (uint8) 6,
  SubClass: (uint8) 1,
  IRQLine: (uint8) 0,
  IRQNO: (uint8) 32
 }),
 (*pci.Device)(0x68024570)({
  Ident: (pci.Identity) {
   Vendor: (uint16) 32902,
   Device: (uint16) 28947
  },
  Addr: (pci.Address) {
   Bus: (uint8) 0,
   Device: (uint8) 1,
   Func: (uint8) 3
  },
  Class: (uint8) 0,
  SubClass: (uint8) 0,
  IRQLine: (uint8) 9,
  IRQNO: (uint8) 41
 }),
 (*pci.Device)(0x68024580)({
  Ident: (pci.Identity) {
   Vendor: (uint16) 7439,
   Device: (uint16) 4369
  },
  Addr: (pci.Address) {
   Bus: (uint8) 0,
   Device: (uint8) 3,
   Func: (uint8) 0
  },
  Class: (uint8) 3,
  SubClass: (uint8) 0,
  IRQLine: (uint8) 0,
  IRQNO: (uint8) 32
 }),
 (*pci.Device)(0x68024590)({
  Ident: (pci.Identity) {
   Vendor: (uint16) 7439,
   Device: (uint16) 32865
  },
  Addr: (pci.Address) {
   Bus: (uint8) 0,
   Device: (uint8) 4,
   Func: (uint8) 0
  },
  Class: (uint8) 1,
  SubClass: (uint8) 8,
  IRQLine: (uint8) 11,
  IRQNO: (uint8) 43
 }),
 (*pci.Device)(0x680245a0)({
  Ident: (pci.Identity) {
   Vendor: (uint16) 7439,
   Device: (uint16) 60448
  },
  Addr: (pci.Address) {
   Bus: (uint8) 0,
   Device: (uint8) 5,
   Func: (uint8) 0
  },
  Class: (uint8) 2,
  SubClass: (uint8) 0,
  IRQLine: (uint8) 0,
  IRQNO: (uint8) 32
 })
}

from eggos.

icexin avatar icexin commented on August 25, 2024 1

Thank you very much for your report.

The network card driver model of eggos is intel's e1000 series. From the PCI list you provided, the network card used by ec2 is the one with vendor 7439 and device 32865, which is an exclusive model of amazon, see https://www.pcilookup.com/?ven=1d0f&dev=&action=submit. I will try to support the virtio driver later, so that the network module can be used on the cloud server. I wonder if ec2 supports virtio network card?

I'm just curious about how you made eggos into an ec2 image?

Thanks again for sharing eggos' attempts on the cloud server.

from eggos.

aidansteele avatar aidansteele commented on August 25, 2024

Hi @icexin, thanks for your quick feedback! I realised the next day that you are indeed correct, EC2 does not use the e1000 so I understand why it couldn't find it ๐Ÿ˜„

I did some more research and the network hardware for EC2 is actually quite complex. There are at least three options that I am aware of:

  • Elastic Network Adapter (which is what is seen in above) which is on the newest instance types (the ones with a "5" in them, e.g. c5, m5, r5)
  • Intel 82599 VF (which uses Intel's ixbgevf driver) on c3, c4, m4 and a few others.
  • Xen's VIF on older instances.

The ENA drivers are open source and seem to be well-documented, but I am not enough of an expert to replicate them in Go: https://github.com/amzn/amzn-drivers/tree/master/kernel/linux/ena. This would be the best perf driver to copy, but I assume it's complex.

The older instances (the ones without ENA) are based on Xen and have the "Xen Platform Device" PCI device attached. It has vendor ID 0x5853 and device ID 0x0001. This appears to be documented here (ctrl+F for xen_platform_pci=1). The network driver on Linux is here.

Regarding eggos -> EC2 image: I can submit a PR sometime in the next few days with a script to do it. But the approximate process is:

  • egg build
  • egg pack to ISO
  • upload ISO to S3
  • aws ec2 import-snapshot --format RAW --user-bucket ... path-to-iso-in-S3 (gives a snapshot ID)
  • aws ec2 register-image ... snapshot-id $snapshotID (gives an AMI ID)
  • aws ec2 run-instances ... --image-id $amiID

Sorry it is not more detailed. It is on my other computer. I will submit a PR soon.

from eggos.

Related Issues (20)

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.