containers / virtcontainers

A Go package for building hardware virtualized container runtimes
Apache License 2.0
139 stars 43 forks source link

wip: Add support for SRIOV #463

Closed amshinde closed 7 years ago

amshinde commented 7 years ago

This PR adds support for passing SRIOV supported NICs to the VM. We check if the network interface passed in the network namespace is a physical device. If a physical network device is found, we skip the bridge creation flow and pass the device directly to the VM through VFIO passthrough. To do this, we unbind the network device from its network driver and bind it to VFIO driver. We do the opposite while stopping the VM.

jodh-intel commented 7 years ago

lgtm.

Aside: I wonder if it's worth having an in-tree-document describing the available features.

Approved with PullApprove Approved with PullApprove

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.9%) to 61.578% when pulling 81fd131f9a1122765ad75b4bcf166c7196ace8bf on amshinde:vfio-networking into 45fe7975442461611854ddbf576f07a20a0b68ee on containers:master.

amshinde commented 7 years ago

@jodh-intel Thanks for taking a look. Yes, I am planning to move the SRIOV documentation that we did for 2.1 here.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.9%) to 61.578% when pulling 7d34cc7b744a91416b51276ebf4249cec2490bca on amshinde:vfio-networking into 45fe7975442461611854ddbf576f07a20a0b68ee on containers:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-2.0%) to 61.495% when pulling 505149eeca5167958bd173e195d8bae5176682c4 on amshinde:vfio-networking into adc504e4132d10e0099e06239d92aa1f9ce36941 on containers:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.4%) to 62.054% when pulling 4ff9a17a0989c10413e6530955bbe9a7510cd5b9 on amshinde:vfio-networking into adc504e4132d10e0099e06239d92aa1f9ce36941 on containers:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.4%) to 62.054% when pulling 37cdeec5763260687eabfbe10b832b582c42a01b on amshinde:vfio-networking into adc504e4132d10e0099e06239d92aa1f9ce36941 on containers:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.4%) to 62.054% when pulling 37cdeec5763260687eabfbe10b832b582c42a01b on amshinde:vfio-networking into adc504e4132d10e0099e06239d92aa1f9ce36941 on containers:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.4%) to 62.054% when pulling 37cdeec5763260687eabfbe10b832b582c42a01b on amshinde:vfio-networking into adc504e4132d10e0099e06239d92aa1f9ce36941 on containers:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.4%) to 62.054% when pulling 37cdeec5763260687eabfbe10b832b582c42a01b on amshinde:vfio-networking into adc504e4132d10e0099e06239d92aa1f9ce36941 on containers:master.

sboeuf commented 7 years ago

LGTM

Approved with PullApprove Approved with PullApprove Approved with PullApprove

sboeuf commented 7 years ago

Waiting for @mcastelino before to merge this

sameo commented 7 years ago

@sboeuf I will continue this review later today.

amshinde commented 7 years ago

@sameo I have pushed changes to introduce switching on the endpoint type. Have left a comment on the interface names. Let me know if you have a preference on it, before I go ahead and make the changes.

sameo commented 7 years ago

@amshinde Thanks for the switch fixes, I also commented on the Endpoint interface getter. Once this is fixed, I'll approve that PR.

sameo commented 7 years ago

LGTM

Approved with PullApprove Approved with PullApprove

sboeuf commented 7 years ago

@mcastelino do you expect more changes or can I merge this PR ?

mcastelino commented 7 years ago

@amshinde please update the SRIOV CNM plugin documentation to show that we can use SRIOV with CC 3.0. https://github.com/clearcontainers/sriov