From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [1/1 take 2] Unified socket storage. (with small bench). Date: Wed, 09 May 2007 02:44:45 -0700 (PDT) Message-ID: <20070509.024445.71552569.davem@davemloft.net> References: <20070508174331.GA13591@2ka.mipt.ru> <20070508.234828.95506666.davem@davemloft.net> <20070509093443.GA10028@2ka.mipt.ru> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: johnpol@2ka.mipt.ru Return-path: Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:40494 "EHLO sunset.davemloft.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754750AbXEIJop (ORCPT ); Wed, 9 May 2007 05:44:45 -0400 In-Reply-To: <20070509093443.GA10028@2ka.mipt.ru> Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: Evgeniy Polyakov Date: Wed, 9 May 2007 13:34:43 +0400 > On Tue, May 08, 2007 at 11:48:28PM -0700, David Miller (davem@davemloft.net) wrote: > > One thing that will need to be adjust for current tree is the UDP > > hashing mechanism. But as far as I can tell your code should be able > > to handle the new scheme (we now hash UDP by saddr+port when > > possible, and this reminds me that IPV6 is broken and needs some > > repairs). > > Yes, udp with multicast can be a problem, but it can be solved exactly > the same way I implemented netlink broadcast (simple solution) - > multicast sockets are placed into own list/hash table/trie with special > bit in key/whatever and accessed when needed. Actually, I am not talking about multicast. :) In 2.6.22 what happens now in UDP is that if a non-wildcard rcv_saddr is specified, we try to hash using the rcv_saddr and the port. But when binding we have to check first if an existing port+wildcard bind exists. See __udp_lib_get_port() in Linus's current tree. > > What exactly does the 'stages' arg mean? Is this a method to handle > > partially bound sockets? > > It is a fallback to select a listening socket, which has remote > addr/port as zero, so when socket it selected from tree, lookup wants to > first get established socket with given remote identity and if this > fails, it tries to select a wildcard one. This kind of logic also has implications for UDP. :-)