Implement flowid calculation for outbound connections to enable splitting connections over multiple paths.
Multipath routing relies on mbuf flowid data for both transit and outbound traffic.
Current code fills mbuf flowid from inp_flowid for connection-oriented sockets.
However, inp_flowid is currently not calculated for outbound connections.
This diff creates simple hashing functions and starts calculating hashes for TCP,UDP/UDP-Lite and raw IP if multipath routes are present in the system.
RSS and ROUTE_MPATH
Multipath routing currently does not require any special properties from the hashing function, except good flow distribution.
RSS for outbound connections (which is actually XPS) require hashing function to be compatible with card hashing to achieve optimal TX ring assignment.
RSS requires PCBGROUP, which makes coupling RSS and ROUTE_MPATH by requiring RSS inconvenient.
With that in mind,
- use RSS-derived hashing functions for outbound connections when RSS in enabled and
- use light-weight ROUTE_MPATH hashing functions otherwise
- implement a simple wrapper layer (see net/route.h) to switch between the implementation without touching callers.