<div dir="ltr">This is SO helpful -- thank you so much.<div><div><br></div><div>One follow-up question regarding NICs: can multiple containers on the same host share the same PCI device? If I have a host NIC with (say) VFIO driver binding, do I have to split it with some kind of SR-IOV so that each container has its own "NIC" binding? Or, when running DPDK's "devbind" script, can I set up each one with the same PCI address? </div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 19, 2024 at 1:29 PM Stephen Hemminger <<a href="mailto:stephen@networkplumber.org">stephen@networkplumber.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On Tue, 19 Nov 2024 12:53:02 -0800<br>
Thea Corinne Rossman <<a href="mailto:thea.rossman@cs.stanford.edu" target="_blank">thea.rossman@cs.stanford.edu</a>> wrote:<br>
<br>
> I'm following up on this to ask a more specific question, since my first<br>
> question was a bit all over the place. This is regarding the interplay<br>
> between the host and the containers when setting up containers that can run<br>
> DPDK applications.<br>
> <br>
> Based on what I've found so far, it looks like I will have to fully<br>
> configure DPDK on the host and then mount devices onto each container, even<br>
> if there's no need to connect the containers to the outside world. (Is this<br>
> correct?) If so, I don't fully understand this, since a container/container<br>
> network should be self-contained.<br>
> <br>
>    - Why do we need to set up DPDK on the host? (Why isn't the container<br>
>    enough?)<br>
>    - Why do we need to set up a DPDK-compatible driver on the host NICs? If<br>
>    the containers are on the same machine, exchanging packets, why would the<br>
>    host NIC be involved at all? Nothing is going in or out.<br>
>    - Why do we need to configure hugepages on the host and then mount them<br>
>    on the container? Why can't you just configure this on the containers? Is<br>
>    this something that can't be emulated?<br>
> <br>
<br>
Containers are a made up construct. They are made by setting permissions for<br>
namespaces and groups for resources.<br>
<br>
In most cases, DPDK works by passing through the raw hardware (PCI device)<br>
to the userspace application. To make it work with a container system you<br>
need to either acquire the resource in an restricted environment and then<br>
allow access to that resource in the restricted container; or you need<br>
to give the restricted container environment lots of privileges to configure<br>
and setup the raw hardware directly. In the latter case, there really is<br>
no point in having containers.<br>
<br>
Same applies to hugepages.  I don't think hugepages are namespaced either.<br>
</blockquote></div>