-
Notifications
You must be signed in to change notification settings - Fork 299
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
One IO app to rule them all #1043
Conversation
# Conflicts: # src/apps/intel/intel1g.lua
Exciting stuff! This is of course something that we sorely need, i.e. a uniform way to incorporate I/O sources into an app network when your requirements are farily generic (e.g. send and receive packets, tag/untag, switch on L2 header, hash on L3/L4 header). I suspect this would suit most Snabb applications and so this IO app has the potential to make them all very flexible: connect to hardware NICs, kernel interfaces, PCAP files, etc. I have two topics that I want to discuss in this context. I will start with the simple one :-). URIShould we create a uniform syntax for selecting IO interfaces? As a user I would really like a concise way to tell a Snabb application what IO mechanism to use. Examples:
and so on. I know that people have already done work in this direction e.g. @dpino for lwAFTR. Could also be that the syntax would need to support more elaborate information, like the IO app parameters of MAC address + VLAN tag + RSS hash bucket, in which case we would need to choose a flexible syntax. (URI?) Control vs TrafficI have a feeling that we should make a separation between control (defining queues, setting up switching rules, choosing hash functions, etc) verses traffic (sending and receiving packets on a specific queue pair.) I say this because I think certain NICs are designed with the expectation that a single entity (traditionally the kernel) will handle all control and that it could be awkward to support these NICs in a strictly peer-to-peer fashion. This would mandate having two kinds of app:
For example the usage could be like this: -- Define the queues.
app("ctrl", IOControl, {queues = {{id="a", mac="10:10:10:10:10:10", vlan=42},
{id="b", mac="20:20:20:20:20:20", vlan=43}},
rssbuckets = 2})
-- Attach to named queues.
app("a1", IO, {queue = "a", rssbucket = 1}
app("a2", IO, {queue = "a", rssbucket = 2}
app("b1", IO, {queue = "b", rssbucket = 1}
app("b2", IO, {queue = "b", rssbucket = 2} It could be that I am not being sufficiently imaginative and that we can support all NICs without needing this The The The new Mellanox ConnectX driver currently does use a separate app for control as shown in the example above. The reason is that controlling the NIC is fairly stateful: the Mellanox firmware API is based on CRUD operations on objects with opaque IDs assigned by the NIC. There are a bunch of different objects to manage: Send Queue, Work Queue, Completion Queue, Receive Queue, Receive Queue Table, Flow Table, Flow Group, etc, etc, etc, and each instance is assigned an ID by the card that needs to be remembered by the controller. So, on the one hand it is possible for each IO app to lock the NIC and perform updates (e.g. recreate Flow Tables to update MAC dispatching), but on the other hand this means defining a shared representation of all the relevant state. I also think that in the future some Snabb hacker somewhere will decide they want to interace with a NIC using a vendor-supplied software stack (as we have with Solarflare in the past) and that this software may not lend itself well to distributing control of the NIC between processes in a peer-to-peer style e.g. if the state we are manging are opaque data structures allocated by the vendor library that we have no way to transport between processes. So, what do we think? How awkward will it be to separately define the IOControl from the IO? Does this awkwardness pay for itself in terms of simplifying implementation? cc @petebristow |
I believe having |
Superseded by #1068. |
This diabolical reinvention of
virtual_ether_mux
pretends to be a regular app, and its transparent indeed. A little change makes it possible:The IO app doesn’t actually implement the usual new/push/pull/… methods, but only a configure method. When the IO app is configured it actually configures other apps to implement the functionality specified by its arguments.
This scheme depends on a standard interface shared among NIC drivers: they need to use standard port names, and validate their respective configurations. See #1025 #1019. In cases where implicit apps are created (e.g. for emulation), their generated names begin with an underscore to avoid accidental collisions.
An app network created by
might look like this:
And the standard links
SoftIO.rx
andSoftIO.tx
can be used as if they were from a network driver.The meat of this PR is f38a8c4, the remaining commits are pulling in @petebristow’s intel_mp driver. Comments are welcome!
TODO:
intel_mp
, we need Intel i350 NICs in the lab. @lukego can I have? AFAIK the ones installed in the luganos are used for the uplink.Emu
app when possible, for this we would need a way to create dummy apps and alias links into them so thatFoo.rx
is actually_SoftIOBridge0.Foo