Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1419360iob; Fri, 29 Apr 2022 05:08:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEIZBmheooJinbisZMOJBl/F0q6sXdXpVg7SiSChgmq9EAJWMPis7LeNdDCaf/3L/iS2Xr X-Received: by 2002:a17:902:c205:b0:15a:2e1b:6360 with SMTP id 5-20020a170902c20500b0015a2e1b6360mr39063782pll.152.1651234125900; Fri, 29 Apr 2022 05:08:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651234125; cv=none; d=google.com; s=arc-20160816; b=O3rc6C3oPyg2au7iPH3/1v7j/zKn3MsVp+OotjV0qa48iHCwpC3JtI7KwYQqLo+QxF 7RcB5ZKRPvsm2VivjW/Od18jBRqrOhwv2uLRo4RqGwKOYWVFaxsDGSdOJ6MMSpNrnVLb O86VSAhIdvEQB1JC1pYpDbYvIhVQY52zgQPFbJF4nsnfI7NHgfWDPPHoPH7fmAU5jEwK Vz77VTxeflZF0xqmjDaAHslHQG1FiReqQAI09iEVzTYDCKu/k5G4bXggpyn+qdjgiejL 5fW1tDAnzTs6ZKDps3okFSK9Y65hab9K0XQi5QNKFfZpJpxyZUowVoJiF5i3FnmhOJQN aneg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=r804qhBejoVRexAENK1j1o67bq5qDN1KpREo3y7KOtk=; b=ugss6ZRd5xDy8blUh8HI0oXylYUCgPWsgUcBp0LGJYF54WuNIOlRptdaF/gXqB2BXh NULb9JrTFT+MKiLtZVyo7O2Hjb7c93Q1+VmZYPDIRAqFKor1ECt3mlNA8Jajs7fD8Mr3 YIHnTMn8SfltbMZEapwBb6VAb6eVe9VjYwkZmeI7bWzQn7nul6rmGqgUoz2DPavfL2EQ 0cbPpSqqXsNYCZ9mydoVqZY1zMIrLW8DfyNtJ35gVZwEdxZf2saFFmB+yb7MF9ygm91i liPkgApfLfHcnd2AfPREcuPW4F/M45kJayEWzdtV3bPDU5/hRMCkuICWkMGpSSGOFnzI Vblw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=e47KqLhw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 35-20020a630b23000000b003abaac38e95si6938559pgl.238.2022.04.29.05.08.29; Fri, 29 Apr 2022 05:08:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=e47KqLhw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352305AbiD2Akx (ORCPT + 99 others); Thu, 28 Apr 2022 20:40:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234331AbiD2Akx (ORCPT ); Thu, 28 Apr 2022 20:40:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A831DBB09E; Thu, 28 Apr 2022 17:37:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 64823B83260; Fri, 29 Apr 2022 00:37:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85C67C385AD; Fri, 29 Apr 2022 00:37:33 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="e47KqLhw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1651192651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=r804qhBejoVRexAENK1j1o67bq5qDN1KpREo3y7KOtk=; b=e47KqLhw/1igQfy2eq3mJRM+YKpFgfTeNVmmeloNuybW9n/gRtZfG9CKImVVy4zzsZqaeG E9wn4CaaV3+67u0mIoqw6qkfQwAL6xzFLbXJFTZXFqx/NqjgC3SlBSkxkSRmLKvpxHgjFb OVV4fCm184F9dbbGT7amlrUDDvNI3m0= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id a2875674 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Fri, 29 Apr 2022 00:37:31 +0000 (UTC) Date: Fri, 29 Apr 2022 02:37:29 +0200 From: "Jason A. Donenfeld" To: Eric Dumazet Cc: Netdev , LKML , kuba@kernel.org, hannes@stressinduktion.org Subject: Re: Routing loops & TTL tracking with tunnel devices Message-ID: References: <20151116203709.GA27178@oracle.com> <1447712932.22599.77.camel@edumazet-glaptop2.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey Eric, On Tue, Nov 17, 2015 at 03:41:35AM +0100, Jason A. Donenfeld wrote: > On Mon, Nov 16, 2015 at 11:28 PM, Eric Dumazet wrote: > > There is very little chance we'll accept a new member in sk_buff, unless > > proven needed. > > I actually have no intention of doing this! I'm wondering if there > already is a member in sk_buff that moonlights as my desired ttl > counter, or if there's another mechanism for avoiding routing loops. I > want to work with what's already there, rather than meddling with the > innards of important and memory sensitive structures such as sk_buff. Well, 7 years later... Maybe you have a better idea now of what I was working on then. :) As an update on this issue, it's still quasi problematic. To review, I can't use the TTL value, because the outer packet always must get the TTL of the route to the outer destination, not the inner packet minus one. I can't rely on reaching MTU size, because people want this to work with fragmentation (see [1] for my attempt to disallow fragmentation for this issue, which resulted in hoots and hollers). I can't use the per-cpu xmit_recursion variable, because I use threads. What I can sort of use is taking advantage of what looks like a bug in pskb expansion, such that it always allocates too much, and pretty quickly fails allocations after a few loops. Only powerpc64 and s390x don't appear to have this bug. See [2] for a description of this in depth I wrote a few months ago to you. Anyway, it'd be nice if there were a free u8 somewhere in sk_buff that I could use for tracking times through the stack. Other kernels have this but afaict Linux still does not. I looked into trying to overload some existing fields -- tstamp/skb_mstamp_ns or queue_mapping -- which I was thinking might be totally unused on TX? Any ideas about this? Thanks, Jason [1] https://lore.kernel.org/wireguard/CAHmME9rNnBiNvBstb7MPwK-7AmAN0sOfnhdR=eeLrowWcKxaaQ@mail.gmail.com/ [2] https://lore.kernel.org/netdev/CAHmME9pv1x6C4TNdL6648HydD8r+txpV4hTUXOBVkrapBXH4QQ@mail.gmail.com/