From owner-freebsd-net@FreeBSD.ORG Tue Jan 14 20:22:48 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1761BB66 for ; Tue, 14 Jan 2014 20:22:48 +0000 (UTC) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com [IPv6:2a00:1450:4010:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9547B14D3 for ; Tue, 14 Jan 2014 20:22:47 +0000 (UTC) Received: by mail-la0-f51.google.com with SMTP id c6so704750lan.24 for ; Tue, 14 Jan 2014 12:22:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=mfzMzxM3i6aKIqzLCgfSfBQyPUbMugG7F3ixHYXEu0g=; b=PnfFD5coNbOwyEF3+UYjgUEDWj9nWqgP6vv4FKCY+v8SmJG74B0rx7TJ0/UilboU8Z HbNA3EJ9MyyE2XEWnE6Mt2fNWLB7Z9bkO5QZsHWGnbamQGJHrr8P5DAwUICvPbePsqwf y2Kw0F25z18n6adD/HHD2Z9F4aObQa6vvyium/FyMuweKF/uHRHlyQOx/eIGPDDNRxgE 7g6GQ8i0K3qjfCWdMfpCCzQr+T6kYckHEuflRlojtI0F7WEZqbs37w1mjgiq6vIOG9yc +TXb6ofwscqFZFsFpFbX6rj3rEbZBCaARlGAfYxLiw8nNXOEXGzfnc1JpXgkTp7kFVtM yKbQ== MIME-Version: 1.0 X-Received: by 10.112.130.35 with SMTP id ob3mr1980968lbb.2.1389730965700; Tue, 14 Jan 2014 12:22:45 -0800 (PST) Sender: ndenev@gmail.com Received: by 10.114.242.33 with HTTP; Tue, 14 Jan 2014 12:22:45 -0800 (PST) In-Reply-To: <52D58E29.7040306@fsn.hu> References: <52D5138B.8050100@fsn.hu> <52D58E29.7040306@fsn.hu> Date: Tue, 14 Jan 2014 20:22:45 +0000 X-Google-Sender-Auth: r4Gbr9aKg9hwBeULL4tvYS6JxAM Message-ID: Subject: Re: ECMP hash keys? From: Nikolay Denev To: Attila Nagy Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jan 2014 20:22:48 -0000 On Tue, Jan 14, 2014 at 7:21 PM, Attila Nagy 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 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