Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jan 2014 20:22:45 +0000
From:      Nikolay Denev <nike_d@cytexbg.com>
To:        Attila Nagy <bra@fsn.hu>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: ECMP hash keys?
Message-ID:  <CA%2BP_MZHT%2BRsY9WCgLXXsNvU5OacsXOcTfXdEmg2jj3D8r0kW%2Bw@mail.gmail.com>
In-Reply-To: <52D58E29.7040306@fsn.hu>
References:  <52D5138B.8050100@fsn.hu> <CA%2BP_MZFQU4%2B05Pk5cZ4NMZujD9vXDrV=mehN7_vz1OZ6r2-f1Q@mail.gmail.com> <52D58E29.7040306@fsn.hu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 14, 2014 at 7:21 PM, Attila Nagy <bra@fsn.hu> wrote:
> Hi,
>
> I've read (well, mostly) OpenBSD's version
> (http://www.openbsd.org/cgi-bin/cvsweb/src/sys/net/radix_mpath.c), and I
> think it would be good to catch up with them.
>
> BTW, I couldn't even get it to work:
> http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/185771
> but I have only netbooted machines, it seems the two don't match currently.
>
>
> On 01/14/2014 08:15 PM, Nikolay Denev wrote:
>>
>> Hi,
>>
>> Currently it's implemented using Modulo-N Hash (RFC2991), see
>> radix_mpath.c:rtalloc_mpath_fib()
>>
>> And as hash the xor of source and destination IP is supplied, look for
>> rtalloc_mpath_fib() in ip_output.c :
>>
>>     ...
>>     #ifdef RADIX_MPATH
>>                          rtalloc_mpath_fib(ro,
>>                              ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr),
>>                              inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m));
>>     #else
>>     ...
>>
>> I've tried to hack this to use m_pkthdr.flowid if it exists, but in my
>> case my network cards were not setting this (vr(4) on soekris) so I
>> did not saw any change. Maybe my idea was completely wrong, but the
>> XOR of src and dst IP is 4 bytes, and this is the size of the flowid
>> as well. (haven't tried with FLOWTABLE enabled though).
>>
>> --Nikolay
>>
>> On Tue, Jan 14, 2014 at 10:38 AM, Attila Nagy <bra@fsn.hu> wrote:
>>>
>>> Hi,
>>>
>>> Does equal cost multipath take only the destination address into
>>> consideration when choosing the route? (I've spent only about two minutes
>>> reading radix_mpath.h, but I've got this impression)
>>>
>>> What would be needed to use src and dst addresses and ports -if
>>> appropriate?
>>>
>>> Thanks,
>>>
>>> _______________________________________________
>>> freebsd-net@freebsd.org mailing list
>>> http://lists.freebsd.org/mailman/listinfo/freebsd-net
>>> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
>
>

I'm running slightly modified r259547, but I've had to disable "device
pf" as I was also getting panics on boot.
I have some of melifaro@'s RADIX_MPATH related fixes applied locally.

And yes, probably some sync up with OpenBSD's mpath code can be done,
however they seem to do some things differently:

 - Multipath route manipulation with route(8) requires the new
"-mpath" flag, which might be something that would be needed for
FreeBSD as well if RADIX_MPATH would become something enabled in
GENERIC, otherwise I think some stuff might break, especially when you
expect to be able to remove a route by simply providing the prefix
without the gateway.

- They seem to also have route priorities in the kernel, which also
seem to be using the mpath code and I'm not sure FreeBSD developers
would agree to merge, as it seems to make the kernel FIB more like a
RIB.

--Nikolay



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BP_MZHT%2BRsY9WCgLXXsNvU5OacsXOcTfXdEmg2jj3D8r0kW%2Bw>