When it comes to routing IP packets, an out-of-band network stack has two options:
OR,
Dovetail favors the latter way of implementing a packet routing system in a companion core. To this end, it provides a dedicated hook which informs such core about the outcome of any routing decision taken by the regular in-band network stack, which involves a device acting as an out-of-band network port. In other words, each time the in-band routing logic determines that some packet should be handed to a particular network device which also handles out-of-band traffic, the companion core is passed the details of the routing decision, specifically the ( destination IP, destination device ) pair.
Dovetail provides no facility to reuse the packet management infrastructure such as network filtering, NAT or traffic shapping implemented by the in-band stack, from the out-of-band stage. If required to operate from the out-of-band stage, an implementation of such features should be provided locally by the companion core.
The Dovetail interface shares the packet routing decision it takes with a companion core by calling the following weakly bound routine which the latter can implement.
This hook is called each time the IPv4 routing logic from the in-band network stack determines that some packet should be handed to a particular network device which also handles out-of-band traffic. A typical implementation of such hook in a companion core would record a private copy of the received information which could be retrieved from the out-of-band stage later on, without sharing any lock with the in-band stack. See the EVL implementation.
The network namespace this decision applies to.
The request being resolved by the routing decision. Specifically, the
( rt->dst.dev
, flp4->daddr
) pair tells us which network device
should be passed an outgoing packet we want to send to a particular
destination referred to by its IPv4 address.
The routing table information which represents the routing decision.
This call always runs in-band, possibly on softirq context.