Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4643657rwb; Tue, 20 Sep 2022 17:46:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4M4+QyXPNu1M8mTHNtyY3/cNYyNNVKs3PxDGjR6QxGIkEEFNgID5H768eLMkM6UlBpFKGY X-Received: by 2002:a17:907:d27:b0:782:cc3:8e87 with SMTP id gn39-20020a1709070d2700b007820cc38e87mr674554ejc.94.1663721179770; Tue, 20 Sep 2022 17:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663721179; cv=none; d=google.com; s=arc-20160816; b=bAvz+D1lC4ABbR+OQTIKbPgKdb5jG3F+0vzT73vSGUvbHR3QSIShb9ZTQ0NqsQWVXh XAgtHtQgYswwN2md910LknqzwCBMpOpYaEaaUp+V+kSOOcWaiXySMAuNme5jYBnCZ5cJ oynGu0Trq+T+sPdWFiDnqKNzcAgePPKntOrk2+rzRVNcYjuy9tghYmYwNoaQ8o0Xltwe zMWPeLwzETMDWNbXMxQcNXzPIUKfw6ltO53XAoaXb7ZY1BWvpm2wDgn/2WkFQgl1CiCy j9m82IsSjCeMgpHgHWbsGL8xUlF1fcspvSvvMfqNMWruBSvFPiNXl/EN6ww7JnkhpqYz 0NZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=GGz9WaKzDkg8eCFn1Kepn79jxbJDKf34bC9PmkW8IrE=; b=pAt3lm/RmO9svjcHK5/7NrOAVdjgu2C3CEdbyetokxcvY9ug+F43BSlZf0tI5jtnkf kRJDj56DY3w9VD6MVE6ZbXhVTLZSYaD0jDsiJiIYMENoM+P6XuSez8CUCGQjZC0/qvZY Vf0UOiTogdyIhW0dWDXsFg2tnrjSrreS6ASb5ClRu+5zxUJIlEZmRoiwyNNGvhlYg9Mi LPOegI/PEZ5ydNyUxEOwNBVO/yz1AklEZ2XavN/aXOQ5fgaNIZlmILP/8o7FqekDiq5S EUxi/MnS3HmuKQcrU2mCF2yiQXHEJAJzVtEKJQl2deXzKZPXOr7lEWrMSMCUvq1CCwYZ e0nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EkQJNjyc; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm10-20020a170907948a00b0077d1df3967asi1019112ejc.563.2022.09.20.17.45.54; Tue, 20 Sep 2022 17:46:19 -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=@kernel.org header.s=k20201202 header.b=EkQJNjyc; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230331AbiIUA0N (ORCPT + 99 others); Tue, 20 Sep 2022 20:26:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230054AbiIUA0L (ORCPT ); Tue, 20 Sep 2022 20:26:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D78D5AC4A; Tue, 20 Sep 2022 17:26:10 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 37DBC6260A; Wed, 21 Sep 2022 00:26:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09145C433C1; Wed, 21 Sep 2022 00:26:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663719969; bh=kOc9LBTqYjvRnyqiu2NdEtQAsHH6QxXzcA0/fNkr1jA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EkQJNjycvM9XX2NLnWE9bHxfpRrLRzubgoehVa/v1+XWC5VA2tzociUkz/SmqTm6s al7FyMeI4EFcYjTPoB04QLDtsZKPfpuMDR2DTHPRwwLAqRIC4Q+8g3OlKyASRLy3h0 MWbK0PJoFGJXhXAigjdYEGmGVEz/6Dn+TdrXMN4yVkLSTO0h3KXjwqAT2BSJva9eBX 35fCSVA3XiKJMwLn+j9YqYaHDxrmhpL2mNfeFxfPaTYN5RWP6ak25v0t2TmEP6XGWJ Yl0vjMlMSb4H5aFCdvRmh32kx49v0TYjuBL4/sNuPPMTeAx8I0o9ZKJpgyReJ2LEjL EcfovXk0an+dw== Date: Tue, 20 Sep 2022 17:26:08 -0700 From: Jakub Kicinski To: Vladimir Oltean Cc: "netdev@vger.kernel.org" , Vinicius Costa Gomes , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" , Eric Dumazet , Paolo Abeni , Voon Weifeng , Vladimir Oltean , Kurt Kanzenbach , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 net-next 7/7] net/sched: taprio: replace safety precautions with comments Message-ID: <20220920172608.5cf6bac1@kernel.org> In-Reply-To: <20220921001625.jwpr5r5tneyoxect@skbuf> References: <20220915105046.2404072-1-vladimir.oltean@nxp.com> <20220915105046.2404072-8-vladimir.oltean@nxp.com> <20220920140119.481f74a3@kernel.org> <20220921001625.jwpr5r5tneyoxect@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 On Wed, 21 Sep 2022 00:16:26 +0000 Vladimir Oltean wrote: > On Tue, Sep 20, 2022 at 02:01:19PM -0700, Jakub Kicinski wrote: > > Another option is DEBUG_NET_WARN_ON_ONCE() FWIW, you probably know.. > > Just for replacing WARN_ON_ONCE(), yes, maybe, but when you factor in > that the code also had calls to qdisc_drop(), I suppose you meant > replacing it with something like this? > > if (DEBUG_NET_WARN_ON_ONCE(unlikely(FULL_OFFLOAD_IS_ENABLED(q->flags)))) > return qdisc_drop(skb, sch, to_free); > > This won't work because DEBUG_NET_WARN_ON_ONCE() force-casts WARN_ON_ONCE() > to void, discarding its evaluated value. > > We'd be left with something custom like below: > > if (IS_ENABLED(CONFIG_DEBUG_NET) && unlikely(FULL_OFFLOAD_IS_ENABLED(q->flags))) { > WARN_ONCE(1, "Trying to enqueue skb into the root of a taprio qdisc configured with full offload\n"); > return qdisc_drop(skb, sch, to_free); > } > > which may work, but it's so odd looking that it's just not worth the > trouble, I feel? I meant as a way of retaining the sanity check, a bare: DEBUG_NET_WARN_ON_ONCE(FULL_OFFLOAD_IS_ENABLED(q->flags)); no other handling. Not sure how much sense it makes here, it's best suited as syzbot fodder, perhaps the combination with offload is pointless.