Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2316546pxb; Sun, 24 Jan 2021 02:55:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqZ2sxVmy1Y2DhciD+mrtQr/4MoAoQ+sZvXjoMKfHC6JWb4dpJ6540vpx8DJlVSGiJuLFG X-Received: by 2002:a50:fc18:: with SMTP id i24mr609141edr.308.1611485730625; Sun, 24 Jan 2021 02:55:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611485730; cv=none; d=google.com; s=arc-20160816; b=caR2ei+xbNFc1OMCmzDHq9aqupKXJCT3voszrzB4ZOdNnw87AtQi22CHS2V06uDK3T 68rtOtKWgxhOzmkDrC33hNrrY9JdBApuN1v16ykTF+MYwyYn9Bf7yOkzGualrm7CB6j/ DqgSUVCN4FkygmRB4O7JzRtXl2U60yHtLnIT+jAi4XqsvsleyQJmTHFodiXkVXi4M7rW 3WaC8c5Uo7FPA4sYbnpU45Q5/XxOywaGAsmt996OxeNFtjrxcslUij3QWl1+QVhj5HxQ hvcdrmn1Bxah6BAUxQA8NlxvS9KG72sLyp6gprU0Fe78suO83uLH1fiOGjwwJ4ECFED3 p8vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=pCGLa7WqA20w3lXUyLnhYtC/LbQ0ipARG8yyYuF69Vk=; b=w9B9iB+tSI1OU6JahwKbWO8dQavPNrEK9wEi1ESAf4K7G0hcRVCQPLJNZoQTz8QD3t mZzqLX2S/JDgyYbmzAiPU/i4z0pmjEmWR9OIuKD8CR04n7LxDC6L3MpmAJIHGiBGa22d auQ11X8/v4fKFxjrePh3on6pYOhHYmCBPZOjD5FzBQDWPFhrd81CxROtQaz8t8nZY5Sd uEtezCmqP5bE1S34I5eEFNDmQDl2/ONA2AbKv1q5tuQXdi02ko6cj07seIIVwkwQhqhZ AU06Z6V44q0akhCjz1OaXgwAZ9QYkjhoo/o+EXwWbXFtB3pkbPvuiPFil0QWP3OUTFT0 YbTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q1si5979820edi.331.2021.01.24.02.55.06; Sun, 24 Jan 2021 02:55:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726682AbhAXKqx (ORCPT + 99 others); Sun, 24 Jan 2021 05:46:53 -0500 Received: from bmailout3.hostsharing.net ([176.9.242.62]:42413 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbhAXKqw (ORCPT ); Sun, 24 Jan 2021 05:46:52 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 3351B100D9411; Sun, 24 Jan 2021 11:46:06 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 0273013BC08; Sun, 24 Jan 2021 11:46:05 +0100 (CET) Date: Sun, 24 Jan 2021 11:46:05 +0100 From: Lukas Wunner To: Jakub Kicinski Cc: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, Daniel Borkmann , Alexei Starovoitov , Eric Dumazet , Thomas Graf , Laura Garcia Liebana , John Fastabend , LKML Subject: Re: [PATCH nf-next v4 1/5] net: sched: Micro-optimize egress handling Message-ID: <20210124104605.GB1056@wunner.de> References: <20210123192624.4cee3b7d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210123192624.4cee3b7d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 23, 2021 at 07:26:24PM -0800, Jakub Kicinski wrote: > On Fri, 22 Jan 2021 09:47:01 +0100 Lukas Wunner wrote: > > sch_handle_egress() returns either the skb or NULL to signal to its > > caller __dev_queue_xmit() whether a packet should continue to be > > processed. > > > > The skb is always non-NULL, otherwise __dev_queue_xmit() would hit a > > NULL pointer deref right at its top. > > > > But the compiler doesn't know that. So if sch_handle_egress() signals > > success by returning the skb, the "if (!skb) goto out;" statement > > results in a gratuitous NULL pointer check in the Assembler output. > > Which exact compiler are we talking about it? Did you report this? > As Eric pointed the compiler should be able to figure this out quite > easily. I tested with gcc 8, 9, 10. No need to report as it's the expected behavior with -fno-delete-null-pointer-checks, whose motivation appears questionable though (per my preceding e-mail). Thanks, Lukas