Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2763963rwd; Mon, 15 May 2023 17:00:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7PfyUmxJhCN1nuopLEi7GpIwOF68fvu1UEnHA/dAkbUJI9O5FEJAeeZHGutrPfgfTTZoBx X-Received: by 2002:a05:6a20:432a:b0:100:5a09:4524 with SMTP id h42-20020a056a20432a00b001005a094524mr33299776pzk.31.1684195221843; Mon, 15 May 2023 17:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684195221; cv=none; d=google.com; s=arc-20160816; b=GHUT780/KYm4uBp3yXJERpcYEo6OP9jucOXhF1MCGEnpEhHRqFv8D+tASX5M+aNs56 keUpfzlPlu8A7CJPBuJn2noEuU574Gg3SflamI6nCTsqnelFvbXCWc03+aM2/aum8trI 6t82Zjk81fQqQE6Um78XxEBYa3qWO7HpeE6xUMDpmiy37h635JeXgXq/xU8mW6g/zXxv PqpRzENOEaHHhR9TP4titFcolQ0EBRtVIrBpLzt4p8v4eu39Sxav88befdUwHJZgXnT+ QLUpaKXQyoRiqcBKvNeSal4ivh1pCZT/SmkLAAcxLV1Jp/cEk5TWlQZOmYREydfcGlIT 8uXw== 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=RYvc5AJ9ic4v+7Jv0Cue6d/v+WlGvy4SGOuFoUu4yI0=; b=GUhMU0o5TXkgE6qXwzPWtZdvkKwDzCdhVSGQUUX629YJ+K7MSZ0fuArSQf2wcyDiPC yZsvCXoZ+qcFlKwSnrvwLufjhLajvD+83vZuyITLbEOBgNotqD23JC6psBbqKDBAQBKg 5CMD6s5TDUvqQCpGYdOnEZxVTk1j1E030adB61K/70nM3Ken2QXzN4U4yBSHmYsaSeQP r6M7OoICMICgd37Dlf9D2Gzc7L13iBEtmWg0R2tatL+/it9D87Dgkyl2PLMVr5F37O3U VmUe+eulb/2mTtxH9fafU72gyeVKrhmDmJPoWjjHOQvnxBqLwPnKu23Xpf5G12ZtxCAf kj5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=HaiKlOln; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 29-20020a17090a035d00b0023d23393318si429845pjf.55.2023.05.15.16.59.28; Mon, 15 May 2023 17:00:21 -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=@gmail.com header.s=20221208 header.b=HaiKlOln; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245314AbjEOWpZ (ORCPT + 99 others); Mon, 15 May 2023 18:45:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbjEOWpX (ORCPT ); Mon, 15 May 2023 18:45:23 -0400 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51F90D052; Mon, 15 May 2023 15:45:22 -0700 (PDT) Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-757942bd912so431878085a.2; Mon, 15 May 2023 15:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684190721; x=1686782721; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=RYvc5AJ9ic4v+7Jv0Cue6d/v+WlGvy4SGOuFoUu4yI0=; b=HaiKlOlnX8LcWlPI8Os1Tl+lYf1Kb+bYS4XKTyzFH8UGat1q2Ndu0974KKemJS9c/4 077IXP+zU7SUJx9c5FeToKtQ34ZZ2XSYFIjeiSqS9JhTpEPSO/nXtUPU1wPagiEHqy6D PnASpY1/izClxtqP8rzYKAnRIupBl8L+UCJy4mUYI/DTYg7ylKRM1wFy54JdDcrpTrAX upmwxBEjlMYys/WAvO+oVfaDYnLDTGe9S+gwhxon7Zz3RPYJDoSsjHtg/Xt/mG8iFRpY 3k6Q1rTVnQqiHAumXM7ZjNMMmMSLV/bYeagRoxT0tHBCZhlgzGK+oUwqdGmE+Y7TIGHk fOwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684190721; x=1686782721; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RYvc5AJ9ic4v+7Jv0Cue6d/v+WlGvy4SGOuFoUu4yI0=; b=T+wURvocVS6G+Bp7xGVarqeh8Ii9p5eVEhQm6HSVzBNTcTs8XS8D81GHpdD4shHDIV 6iOmE1NA11Hbr4nu0ZQb0hOpi9dSbPKCIE9h5KJag7GgJ0dexEkR6Dx7xtqEhdzm8fja 8CJIZ+RHtG0J3QuyRSrDKyxdsTBnVr6mWmN/vs3Lv8Plg2YHYRfCrlLJIJHsxtD5m25/ vvokYr5phiL+N3NSxMmwNQXtlmNkd5ytOlohTqQtYmuSeij0+VJmepZqOPVpWlFrfHDI 18ZyxRmVcmRy+3YgG6FFsIuXDJDA/aHd93qhvBmViXjl8uUu56FBmy2dC+D6TpbUZsBn CHaA== X-Gm-Message-State: AC+VfDw6yMrbeNX5NnTA7gpOJEDTTamjapnNSemcu5u4GFLGmsNiMBSm uQgKl/4ao9DGjwFrLwXeyQ== X-Received: by 2002:ad4:5e88:0:b0:61b:6e28:5c3a with SMTP id jl8-20020ad45e88000000b0061b6e285c3amr58508422qvb.27.1684190721396; Mon, 15 May 2023 15:45:21 -0700 (PDT) Received: from C02FL77VMD6R.googleapis.com ([2600:1700:65a5:6400:e9e0:2451:1fdc:4815]) by smtp.gmail.com with ESMTPSA id bv24-20020a05622a0a1800b003f3c9754e1dsm5166927qtb.17.2023.05.15.15.45.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 15:45:20 -0700 (PDT) Date: Mon, 15 May 2023 15:45:15 -0700 From: Peilin Ye To: Jakub Kicinski Cc: Jiri Pirko , Daniel Borkmann , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jamal Hadi Salim , Cong Wang , Peilin Ye , John Fastabend , Vlad Buslov , Pedro Tammela , Hillf Danton , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Cong Wang Subject: Re: [PATCH net 6/6] net/sched: qdisc_destroy() old ingress and clsact Qdiscs before grafting Message-ID: References: <20230508183324.020f3ec7@kernel.org> <20230510161559.2767b27a@kernel.org> <20230511162023.3651970b@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Thu, May 11, 2023 at 05:11:23PM -0700, Peilin Ye wrote: > > > ->init() may be too early, aren't there any error points which could > > > prevent the Qdisc from binding after ->init() was called? > > > > You're right, it's in qdisc_create(), argh... > > ->destroy() is called for all error points between ->init() and > dev_graft_qdisc(). I'll try handling it in ->destroy(). Sorry for any confusion: there is no point at all undoing "setting dev pointer to b1" in ->destroy() because datapath has already been affected. To summarize, grafting B mustn't fail after setting dev pointer to b1, so ->init() is too early, because e.g. if user requested [1] to create a rate estimator, gen_new_estimator() could fail after ->init() in qdisc_create(). On the other hand, ->attach() is too late because it's later than dev_graft_qdisc(), so concurrent filter requests might see uninitialized dev pointer in theory. Please suggest; is adding another callback (or calling ->attach()) right before dev_graft_qdisc() for ingress (clsact) Qdiscs too much for this fix? [1] e.g. $ tc qdisc add dev eth0 estimator 1s 8s clsact Thanks, Peilin Ye