Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3370483imm; Fri, 24 Aug 2018 16:02:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaA93gEhawyuAL/eMEWeAlloyuxfB4+xpJcfepBhK/0kkRtFX/t7rQn/AeWGBa3vkozxS+u X-Received: by 2002:a63:77ce:: with SMTP id s197-v6mr3518404pgc.172.1535151750352; Fri, 24 Aug 2018 16:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535151750; cv=none; d=google.com; s=arc-20160816; b=SZ+7yS5Dha3J2NcWKPKMsz+AONcaVwU3QRmdJeYVY35UZw5QCAQ6fEMAjC+LPgaLtB W8MZZXMVvYoZxNqp1XUVYwqLip4PlUVaABrHxogv67c6JsIt4Yzjqj3zSytFh0+ldv+v y5v+FlaR6PyORwjMIw3VcvHHKtCVYB+BAoNtjA7XQbc861/7bNEC36wqsoL5/iIdTstc AyPO/7Ew7juHNQfIVBB4/0zR1tGeALeD5xoB5zuHd7A6LZYO0Uc2sab+u7YznmJzKyAQ bzByVreSfwehWbXN+RWzrAPMsw9BDo3WTPHKVdMx3smixncvsCIw9bVmjoxllJHXnWtr OlWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=CmvPqGsdv8cxd+iRh2wVhcrhYkRTBVRbGGcMmV7quUs=; b=N20pIAsAzUueP1Qf1+r6Pw+cpXqTXR9egQjWR82H30cEdSvTONpYajmbxuGk1cVcv3 gP30BvZZmP8/HUMJzLVJa2bQ0pTP36RDChx/TXbGAx4mnTlxJXCEFltFtR/hw4kY9R0P 8i1txcVOzmWaE01gmo4DOi4aRCKCMw8IRqNA1MEK8cSOetLFbKYNtOYuU/S3EHPNFsjc Tm6G2eNMTkDvqtwRRfhW4KHxe+ywn/pVRoYTh+XV70kYOIhGuhf3pUxFxAKq2gG5B37c v5um/AsZP2jT1VikG15pgWnF7y902sx0s2AbGVJgvmtSnK94695bf1kSmjo6XXdcfSGo 6hhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=uVDDj8jr; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s6-v6si8211245pgg.41.2018.08.24.16.02.14; Fri, 24 Aug 2018 16:02:30 -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=@lunn.ch header.s=20171124 header.b=uVDDj8jr; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727499AbeHYCh3 (ORCPT + 99 others); Fri, 24 Aug 2018 22:37:29 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:42807 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbeHYCh2 (ORCPT ); Fri, 24 Aug 2018 22:37:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=CmvPqGsdv8cxd+iRh2wVhcrhYkRTBVRbGGcMmV7quUs=; b=uVDDj8jrR+pEngSwN4uqvpPKsygrDbrjKuCbBDf1XBwUHlt/IdLo/jtVLmEqYU7x9d36ZEJZWdzGNwtWIikL94aS31pWW1WE3P/K/xQITMIV5TgheEB7rfnSrh/yg/EOSwBjgbbRfs4glaALj+9yrKInmjW2G4Le9Ngg6UvfTTo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1ftL4Q-0003SJ-0J; Sat, 25 Aug 2018 01:00:46 +0200 Date: Sat, 25 Aug 2018 01:00:45 +0200 From: Andrew Lunn To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, davem@davemloft.net, Greg KH Subject: Re: [PATCH v2 17/17] net: WireGuard secure network tunnel Message-ID: <20180824230045.GH27483@lunn.ch> References: <20180824213849.23647-1-Jason@zx2c4.com> <20180824213849.23647-18-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180824213849.23647-18-Jason@zx2c4.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jason It is normal to include after the --- what you have changed since the previous version. I ran checkpatch on this again. Last time, we had: total: 6 errors, 763 warnings, 6514 lines checked This time, we have: total: 8 errors, 196 warnings, 7470 lines checked So much better with the warnings. Thanks. The errors should be simple to fix: ERROR: that open brace { should be on the previous line ERROR: that open brace { should be on the previous line ERROR: spaces required around that '=' (ctx:VxW) ERROR: spaces required around that '=' (ctx:VxW) ERROR: spaces required around that '=' (ctx:VxW) ERROR: that open brace { should be on the previous line ERROR: Use of __initconst requires a separate use of const ERROR: trailing whitespace One appears to be a false positive: +static const struct { + bool result; + unsigned int msec_to_sleep_before; +} expected_results[] __initconst = { + [0 ... PACKETS_BURSTABLE - 1] = { true, 0 }, + [PACKETS_BURSTABLE] = { false, 0 }, + [PACKETS_BURSTABLE + 1] = { true, MSEC_PER_SEC / PACKETS_PER_SECOND }, + [PACKETS_BURSTABLE + 2] = { false, 0 }, + [PACKETS_BURSTABLE + 3] = { true, (MSEC_PER_SEC / PACKETS_PER_SECOND) * 2 }, + [PACKETS_BURSTABLE + 4] = { true, 0 }, + [PACKETS_BURSTABLE + 5] = { false, 0 } +}; Looking at some of the warnings: WARNING: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #428: FILE: drivers/net/wireguard/allowedips.c:112: + BUG_ON(len >= 128); WARNING: Macros with flow control statements should be avoided #5905: FILE: drivers/net/wireguard/selftest/ratelimiter.h:87: +#define ensure_time do { \ + if (time_is_before_jiffies(loop_start_time + \ + maximum_jiffies_at_index(i))) { \ + if (++tries >= 5000) \ + goto err; \ + gc_entries(NULL); \ + rcu_barrier(); \ + msleep(500); \ + goto restart; \ + } \ + } while (0) WARNING: Macros with flow control statements should be avoided #6948: FILE: drivers/net/wireguard/timers.c:29: +#define peer_get_from_timer(timer_name) \ + struct wireguard_peer *peer; \ + rcu_read_lock_bh(); \ + peer = peer_get_maybe_zero(from_timer(peer, timer, timer_name)); \ + rcu_read_unlock_bh(); \ + if (unlikely(!peer)) \ + return; are not very nice. WARNING: Possible unnecessary 'out of memory' message #5306: FILE: drivers/net/wireguard/selftest/allowedips.h:261: + if (!peers) { + pr_info("allowedips random self-test: out of memory\n"); kcalloc and friends are pretty noisy when they fails. No need to add your own print. I see we still have a lot of __always_inline in C files :-( Andrew