From owner-freebsd-net@FreeBSD.ORG Thu Jan 16 21:08:01 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 42811386; Thu, 16 Jan 2014 21:08:01 +0000 (UTC) Received: from mail-oa0-x22b.google.com (mail-oa0-x22b.google.com [IPv6:2607:f8b0:4003:c02::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D6FC8193F; Thu, 16 Jan 2014 21:08:00 +0000 (UTC) Received: by mail-oa0-f43.google.com with SMTP id h16so3081271oag.30 for ; Thu, 16 Jan 2014 13:07:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Up8yVxEtAI18pLKmlXBIrBwgF8GPnHnkZK2L1Os3Mko=; b=erQWD1iy2/sX7yyD50M+j7MynDtWKNasKxXCdV63uji+eo7RZV8+gi63xJDFYFdKxs yTa5wZjM7g0+zm5ZEdcGXAqtTryNdKtEUSkQFBBt/0Ny2reCN8yCAlLxSCZbOruNW+uC lnSEtX0wRPGQ9ktGA2nVrwUFi9Qdp9AisifzP94RGID+jxRU4brdiVcJRUVMUPggaGef jckgfAf8x3SfqSSQCkAUZ+cLI4pbfqKRpYyyw3BwdKJYwGvkQ6TUOhU+nAeb+n1kyWSd zZle2v9yGCWaXOpwosJ6wqFSoEumVe7zlNG3jFLGWMXI9NgG0r0xNg1DlowSBZ7/g+OF 6NEw== MIME-Version: 1.0 X-Received: by 10.60.52.14 with SMTP id p14mr9078522oeo.28.1389906479769; Thu, 16 Jan 2014 13:07:59 -0800 (PST) Received: by 10.182.153.65 with HTTP; Thu, 16 Jan 2014 13:07:59 -0800 (PST) In-Reply-To: References: <52D5138B.8050100@fsn.hu> <52D6525D.50102@FreeBSD.org> Date: Thu, 16 Jan 2014 13:07:59 -0800 Message-ID: Subject: Re: ECMP hash keys? From: Vijay Singh To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "freebsd-net@freebsd.org" , "Alexander V. Chernikov" 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: Thu, 16 Jan 2014 21:08:01 -0000 FYI, there is a Toeplitz hash function that gnn is reviewing for me and should be in the system soon. It would be used in the PCBGROUP framework when the hash needs to be generated in SW. On Wed, Jan 15, 2014 at 7:22 AM, Adrian Chadd wrote: > 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 > _______________________________________________ > 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" >