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.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham 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 A252BC31E51 for ; Tue, 18 Jun 2019 13:53:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 829172147A for ; Tue, 18 Jun 2019 13:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728903AbfFRNxB (ORCPT ); Tue, 18 Jun 2019 09:53:01 -0400 Received: from Chamillionaire.breakpoint.cc ([193.142.43.52]:52690 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbfFRNxB (ORCPT ); Tue, 18 Jun 2019 09:53:01 -0400 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.89) (envelope-from ) id 1hdEXj-0000bj-0H; Tue, 18 Jun 2019 15:52:59 +0200 Date: Tue, 18 Jun 2019 15:52:58 +0200 From: Florian Westphal To: Jakub Sitnicki Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, kernel-team@cloudflare.com Subject: Re: [RFC bpf-next 0/7] Programming socket lookup with BPF Message-ID: <20190618135258.spo6c457h6dfknt2@breakpoint.cc> References: <20190618130050.8344-1-jakub@cloudflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190618130050.8344-1-jakub@cloudflare.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Jakub Sitnicki wrote: > - XDP programs using bpf_sk_lookup helpers, like load balancers, can't > find the listening socket to check for SYN cookies with TPROXY redirect. Sorry for the question, but where is the problem? (i.e., is it with TPROXY or bpf side)? > - TPROXY takes a reference to the listening socket on dispatch, which > raises lock contention concerns. FWIW this could be avoided in similar way as to how we handle noref dsts. The only reason we need to take the reference at the moment is because once skb leaves the TPROXY target hook, the skb could leave rcu protection as well at some point (nfqueue for example). Maybe its even enough to move reference taking to nfqueue and add 'noref' destructor, that would allow skb_steal_sock to propagate refcounted value in __inet_lookup_skb. So, at least for this part I don't see a technical reason why this has to grab a reference for listener socket. > - Traffic steering configuration is split over several iptables rules, at > least one per service, which makes configuration changes error prone. Could you perhaps sketch an example ruleset (doesn't have to be complete nor parse-able by itpables-restore), I would just like to understand if there is any room for improvement on netfilter/iptables/nft side. Thanks, Florian