Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp224938imm; Thu, 2 Aug 2018 17:37:09 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfnKKgeeuG9hXziRIO2M8oP/WDXcpaEmIGpxKFLn7tTWZUx8aFjLAoFBhu7xQfPNoR/lqKu X-Received: by 2002:a17:902:246a:: with SMTP id m39-v6mr1393599plg.57.1533256629616; Thu, 02 Aug 2018 17:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533256629; cv=none; d=google.com; s=arc-20160816; b=l6Pt4n+opaBUfpFm4/OdnIpiscAlPSfnB0Q67u4b4Z2cv/BukbzD/xpjVRxikYqP5y KKqlshwuu4Hk3lh0MBxoarNe5rCjX7c6wGAEhOaDTICM24esTb4fcsdXaPvrKIHz+IBZ Xj3o00KlnERKUKoL6S83IXGSxVUwpttBuWscCEYGMG6TZjxS/cK7RX0yvI4/VBxc9auy 4BvMrITMJJ5BjnIqKdYUN6s2RM8Wx0XpavO3J+2Cr3P2xX0rAY5u7b8Jo/KtlFEod+51 zrC3lWRXOnrsDXN8o2+YExmnrWmw33Sxv5xSW0WaM0qBlKgxi7zoLoChaOKFZJwdUZOL sJjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=WS85ta2dAIFPrKMC2d8UwCTzn5fLETJEMAfplLPEBZ0=; b=ywhS9w3XmHe8qrlJomL7dtgjCAMyV3ugnhuSxEhXWpWs9Q3fWVlRvQR46MsDsVU81c 45eC1geKTuXeAks3C7EPAXWkPcEPl+b6Vr6UgrBop78B558c7nf1+nFbejG5M+cwjTfm 4eIdJvqv2pmmLswNA3/SNFPjF213rmUIUi4A5EaFUSInfODzYay2X4ZYw1Phh7+dVil0 8UsEYXN6Z0Gmaj+R2Wd9y19rlUOcincDnIv6Bk+M8sah4ZxbEnJtdv1uopQo1ZMwsiVt LL3twp6rv4+xetcPe8+nmItR0eO15LTZpJyQW9X0jibBqnkJrEjngBEbMQkUSSI9Z63n MUxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=zEK0+I24; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi1-v6si2479988plb.399.2018.08.02.17.36.52; Thu, 02 Aug 2018 17:37:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=zEK0+I24; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1732280AbeHCC3d (ORCPT + 99 others); Thu, 2 Aug 2018 22:29:33 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:57447 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727053AbeHCC3d (ORCPT ); Thu, 2 Aug 2018 22:29:33 -0400 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 923f85b4; Fri, 3 Aug 2018 00:24:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc :content-type; s=mail; bh=I3Vf4yo9VidRu9kA8u15Ys+9FJM=; b=zEK0+I 24cRhY1YV+pPgDAYQisJ3UNDTZj2u0WC6Hi60lPT1H/v51rjtLL3oQ7I+dqKft8F HUKGiRE8Y+pfQqWJ5s1wPkvoUEafMv3Cr7zX5BF+Tn+T4zNEDhIZ941d6xSjH4h7 SMYRcoZBZP+8l/hhigVgghdM7Lfz8aqSsvSbt3zqd6l/I0voT9NHbwkrO5cp3sew c9ERDjQSakn10mGRB4nc4eOgLJxx3z32kp9NOEboPqB47zcnQWh6a7xesmCSix4P qUZczgcP3tBOjqFQPLU+v9ziCVI4zjlsH8w2LYCl3SPwNVEtRD/XsnoTQgRVkW26 7JeK/3TWkHyusYcA== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 89a64f80 (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128:NO); Fri, 3 Aug 2018 00:24:15 +0000 (UTC) Received: by mail-oi0-f51.google.com with SMTP id y207-v6so6802860oie.13; Thu, 02 Aug 2018 17:35:52 -0700 (PDT) X-Gm-Message-State: AOUpUlHzboHArem5XgBShuHL75RhCx+Sx4vazhlu60czMWpyo8upcMRD G6HtRuonL/t6taj1BTN4DfVOyPw8ezURp9z4yOc= X-Received: by 2002:aca:bec2:: with SMTP id o185-v6mr1134299oif.22.1533256552275; Thu, 02 Aug 2018 17:35:52 -0700 (PDT) MIME-Version: 1.0 References: <20180731191102.2434-1-Jason@zx2c4.com> <20180731191102.2434-4-Jason@zx2c4.com> <20180731132701.522b55e2@xeon-e3> In-Reply-To: <20180731132701.522b55e2@xeon-e3> From: "Jason A. Donenfeld" Date: Fri, 3 Aug 2018 02:35:40 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 3/3] net: WireGuard secure network tunnel To: Stephen Hemminger Cc: LKML , Netdev , David Miller , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 31, 2018 at 10:02 PM Andrew Lunn wrote: > I just gave this patch to checkpatch.pl... On Tue, Jul 31, 2018 at 10:22 PM Stephen Hemminger wrote: > Please break lines at something reasonable like 100 characters. If the long lines really truly are dreadful, I have no problem fixing that up for v2. On Tue, Jul 31, 2018 at 10:02 PM Andrew Lunn wrote: > > +static __always_inline void swap_endian(u8 *dst, const u8 *src, u8 bits) > There is a general preference to not force the compile to > inline. Leave it to decide. I'm aware this is for the most part the case, and I've read the variety of threads and documentation of folks explaining why this is a good policy. In the particular instance of that function, inlining is in fact always the right thing to do. But I'll give it a double check to see if the compiler is already figuring that out on its own. > > > +#define push(stack, p, len) ({ \ > > + if (rcu_access_pointer(p)) { \ > > + BUG_ON(len >= 128); \ > > + stack[len++] = rcu_dereference_protected(p, lockdep_is_held(lock)); \ > > + } \ > > + true; \ > > +}) > > > +#undef push > > + > > > +#define push(p) ({ BUG_ON(len >= 128); stack[len++] = p; }) > > This is going to lead to bugs, coders thinking push() does one thing, > when it actually does something else. I would suggest making these > helper functions, with useful names. Good suggestion. Fixed up already for v2. On Wed, Aug 1, 2018 at 3:21 AM Shawn Landden wrote: > Does ratelimiter_selftest still always fail on slow CPUs? No. On Tue, Jul 31, 2018 at 10:27 PM Stephen Hemminger wrote: > This looks like you are doing traversal to free a tree. The stack is there so that you do the rcu callbacks > in the proper order. Won't this create an lot of RCU work at once? Nice observation; you're right. I've fixed this now so that it does the traversal inside a single RCU callback, and have it queued up for v2. Thanks for the suggestions! Keep 'em coming, and I'll keep making modifications. Thanks, Jason