Messages in this thread | | | From | Matteo Croce <> | Date | Wed, 30 Oct 2019 00:03:38 +0100 | Subject | Re: [PATCH net-next v2 4/4] bonding: balance ICMP echoes in layer3+4 mode |
| |
On Tue, Oct 29, 2019 at 10:03 PM Eric Dumazet <eric.dumazet@gmail.com> wrote: > > > > On 10/29/19 11:35 AM, Nikolay Aleksandrov wrote: > > > Hi Matteo, > > Wouldn't it be more useful and simpler to use some field to choose the slave (override the hash > > completely) in a deterministic way from user-space ? > > For example the mark can be interpreted as a slave id in the bonding (should be > > optional, to avoid breaking existing setups). ping already supports -m and > > anything else can set it, this way it can be used to do monitoring for a specific > > slave with any protocol and would be a much simpler change. > > User-space can then implement any logic for the monitoring case and as a minor bonus > > can monitor the slaves in parallel. And the opposite as well - if people don't want > > these balanced for some reason, they wouldn't enable it. > > > > I kind of agree giving user more control. But I do not believe we need to use the mark > (this might be already used by other layers) > > TCP uses sk->sk_hash to feed skb->hash. > > Anything using skb_set_owner_w() is also using sk->sk_hash if set. > > So presumably we could add a generic SO_TXHASH socket option to let user space > read/set this field. >
Hi Eric,
this would work for locally generated echoes, but what about forwarded packets? The point behind my changeset is to provide consistent results within a session by using the same path for request and response, but avoid all sessions flowing to the same path. This should resemble what happens with TCP and UDP: different connections, different port, probably a different path. And by doing this in the flow dissector, other applications could benefit it.
Also, this should somewhat balance the traffic of a router forwarding those packets. Maybe it's not so much in percentage, but in some gateways be a considerable volume.
Regards, -- Matteo Croce per aspera ad upstream
| |