From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDD1CC3A5A8 for ; Wed, 4 Sep 2019 19:26:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B03C12077B for ; Wed, 4 Sep 2019 19:26:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l2Wfe/cO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730440AbfIDT0X (ORCPT ); Wed, 4 Sep 2019 15:26:23 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]:34715 "EHLO mail-wr1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729872AbfIDT0X (ORCPT ); Wed, 4 Sep 2019 15:26:23 -0400 Received: by mail-wr1-f50.google.com with SMTP id s18so42870wrn.1 for ; Wed, 04 Sep 2019 12:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zKZ9aHvD6PjJwGVRhczGVMvf0jMBBtcP/ZZ2tgpkDcI=; b=l2Wfe/cOz1uHnuj9Xx5CHH3pPLfS3bcmpNZSWp6uKs8Z5Yr7a1MfuliGZFV82Xwsan QaDmJqexuU8yn/QMs8Bs0ZhgPr/jV/br3pV6Psqhrrw/E/6blj87HbOKdFCQ5fC+POrr VgDfpAwQ4HDy6C2l96K77JRqNq3dNh92NlSFMeg7bG3ouIj2Ofb+wzf/Wx+6/Is59h0q fYTywRLzqPKOs6/KAr9oO5mehDd8/20+k5vXpLcUcnYzhlRNpKVBn09q7tKBB4Lapgfl pzh3CX2Zr/s39DbJaW/+tkE3PrFgxn9enZKGSlgBRA2up8JXqwqPtk1800vQtDD4kRFt H3Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zKZ9aHvD6PjJwGVRhczGVMvf0jMBBtcP/ZZ2tgpkDcI=; b=t3x5sfZElxBicNmQBPLsHCJ9qT+0AmKfdjDOS7XzSqzaicjE3YVyCs3ywwzleox+rJ KbUix5MDBP8jzVZaabOFxbfy2A8XK0h8ea/V7yrnz4p13x6TrDmOedYyisdo0zsiyOub rxPESrDT4fG7DDCcdC8y58ni0QmZyOFkL3pITwPRu21ONgX7wc4NovUVXFFp/wjrFz4w Dh/WdbxxaiKObit3lmHrv//WOg999nSTTV9BvyZX9HLogaZXqW89SBBOshz1wUJbFHWg K/wPDS2AtkuN/2Tk5ljXSsVwasAJE6BGirzax1ssusojqSn1xEUZY2BX6L/4q8tm76JF Z5Aw== X-Gm-Message-State: APjAAAX0Io7xZ0OAqfqGYY/p8vnvsmucbCzYJ1u/bB64ex+Nv9POv/WS ZpgHIO9EBCSwC/NsRhEzX+M= X-Google-Smtp-Source: APXvYqwS3vzJMbEr1/FItiKWaqyswLeQuhN0u30hWPMZ3h8QiPsqEhiUQ6ED42BoMalB+/K9qMCQLg== X-Received: by 2002:adf:a55d:: with SMTP id j29mr47318859wrb.275.1567625181811; Wed, 04 Sep 2019 12:26:21 -0700 (PDT) Received: from [192.168.8.147] (206.165.185.81.rev.sfr.net. [81.185.165.206]) by smtp.gmail.com with ESMTPSA id z12sm16228349wrt.92.2019.09.04.12.26.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Sep 2019 12:26:21 -0700 (PDT) Subject: Re: Is bug 200755 in anyone's queue?? To: Willem de Bruijn , Steve Zabele Cc: Eric Dumazet , Mark KEATON , Network Development , "shum@canndrew.org" , "vladimir116@gmail.com" , "saifi.khan@strikr.in" , Daniel Borkmann , "on2k16nm@gmail.com" , Stephen Hemminger References: <010601d53bdc$79c86dc0$6d594940$@net> <20190716070246.0745ee6f@hermes.lan> <01db01d559e5$64d71de0$2e8559a0$@net> <8f4bda24-5bd4-3f12-4c98-5e1097dde84a@gmail.com> <00aa01d5630b$7e062660$7a127320$@net> <4242994D-E2CF-499A-848A-7B14CE536E33@raytheon.com> From: Eric Dumazet Message-ID: <87cef966-a94c-7705-26a6-0d6361f98a7a@gmail.com> Date: Wed, 4 Sep 2019 21:26:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 9/4/19 5:46 PM, Willem de Bruijn wrote: > On Wed, Sep 4, 2019 at 10:51 AM Steve Zabele wrote: >> >> I think a dual table approach makes a lot of sense here, especially if we look at the different use cases. For the DNS server example, almost certainly there will not be any connected sockets using the server port, so a test of whether the connected table is empty (maybe a boolean stored with the unconnected table?) UDP hash tables are shared among netns, and the hashes function depend on a netns salt ( net_hash_mix()) (see udp_hashfn() definition) So a boolean would be polluted on a slot having both non connected socket on netns A, and a connected socket for netns B. should get to the existing code very quickly and not require accessing the memory holding the connected table. For our use case, the connected sockets persist for long periods (at network timescales at least) and so any rehashing should be infrequent and so have limited impact on performance overall. >> >> So does a dual table approach seem workable to other folks that know the internals? > > Let me take a stab and compare. A dual table does bring it more in > line with how the TCP code is structured. >