From owner-freebsd-net@FreeBSD.ORG Wed Jan 15 15:22:28 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 8003140C; Wed, 15 Jan 2014 15:22:28 +0000 (UTC) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2DA5A1DF2; Wed, 15 Jan 2014 15:22:28 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id x13so1051416qcv.5 for ; Wed, 15 Jan 2014 07:22:27 -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=toXs8X/mjlLuAZvCxGOvwX1MrPJqYPyWIVi05/SE6S4=; b=KCg+BFxyzBf9jQftiPHIQedot1uW6AEufdZE3ckiQRBY9vfcjCulLqk9xkaqu8Ti7J AQCIT8Rynd8y5e4OcS+7ztcm4MQf2T2XDUxEO+gJJfL26doasklbO//1UUbOHQwLc+WE lm8ZuMKDSr4IN1EXMPBRrdfAW6gVSPZRYVBeo4VP1sLoh09/goKwXCPIG/9L6jkn7RIE g2pg0Z+g/c+nqtRWN29i4KNHqOpvy7i6Zg2AYuI+jiVlnuIg9xuhjAPkctgoK4Km1ZFo 3D9+cnIgP2wjiHL+tAmcMu2rmwVWiFqF4xtACFnICOAJM+E0UpDeoUyM8vVALZ/yUdnC K+Wg== MIME-Version: 1.0 X-Received: by 10.49.28.65 with SMTP id z1mr5506500qeg.78.1389799347052; Wed, 15 Jan 2014 07:22:27 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.52.8 with HTTP; Wed, 15 Jan 2014 07:22:27 -0800 (PST) In-Reply-To: <52D6525D.50102@FreeBSD.org> References: <52D5138B.8050100@fsn.hu> <52D6525D.50102@FreeBSD.org> Date: Wed, 15 Jan 2014 07:22:27 -0800 X-Google-Sender-Auth: Ns0i-3SwtKRQhXzGqW2mSW-OecQ Message-ID: Subject: Re: ECMP hash keys? From: Adrian Chadd To: "Alexander V. Chernikov" 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: Wed, 15 Jan 2014 15:22:28 -0000 On 15 January 2014 01:18, Alexander V. Chernikov wrote: > On 14.01.2014 23:15, Nikolay Denev wrote: >> >> Hi, >> >> Currently it's implemented using Modulo-N Hash (RFC2991), see >> radix_mpath.c:rtalloc_mpath_fib() > > Yup. I'm going to change this to use flowid. > >> >> 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 > > You can try http://static.ipfw.ru/patches/netisr_ip_flowid.diff to get > flowid values generated by netisr. Hm, this is interesting. I wonder if we should (finally) add in the toeplitz hash here and then make sure we are hashing the frame based on the right header contents and direction (so transmit and receive path frames hash to the same value.) What do you think? -a