Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2604522rwd; Wed, 17 May 2023 11:51:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6P2p9RhXFsxCBG04ie0bx5B3xrBdjmMOVqDhL+U3+6naubCEChEOAweIo6Nysw3llUVEGa X-Received: by 2002:a17:902:ce91:b0:1ad:ddf0:131f with SMTP id f17-20020a170902ce9100b001adddf0131fmr27032603plg.51.1684349487349; Wed, 17 May 2023 11:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684349487; cv=none; d=google.com; s=arc-20160816; b=cDNbAk+3Z3A/HAtSvnub7mSHnzTcAyxrcSpqCVc9eTbXgdaaHOK/k5W2aEW8/VDfVU cCuAcKeIu8QZLs/b79hBPgbRWslupYBopEalqRM6OuZ+Z9IkyX0u0yQSsh9UmempHfPo qI5tZcIS5PWhewsibEKJL/wYuHmb4fDEd8H2l7t9uX9dcYXoTGr0urGvIyka6gCeNBHH qsHCPIU6DFz+CzSjFHExPNW+43d0d3nN8zUcngKlw6lGfv4fUAZ1sfrT8/twnu8v4ZsF MVjr6+Sxw3tVyxJWUwzh4mwzE5Ow9GiuU8Kdsufy6cYi2mAMfYq2WqY+gcJwjMYmw5iG tYKg== 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=foGUkSezLfT7ZZQbt1/pvK7ddvfNsnGudjzp0HHbBmI=; b=FsYyHBZCfNMv5YDtUz01jYAI1aBD3h3GP8erXrbPQjxweMHHhwfvu90hiERkJ4aVTY oMxaailVFC6Ue9KP+oksnVMCSHTZ8cwjgJb9WK2JBiKt8FQZLPgADxEL4mEaEzcyDasb PeWFm7zR5OpsbzwY6AGr67z04QiyIeb9C4I1HWs0Wwu63I4wbXWrQdyGTT45VSfYJaKq Q90+APrYaAyuov63I4Eaz3fVgepbnPFBYkXoVMojYtu+1G2uCB+BdfwsDXj0dpc/M/nZ MwbZQr6e+4TRnM+miBkP4LKOL59laTsFs83CM/WqMkPqvyedN/K7fdpPQmaUgD1VQHlD n05Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kSMgvqNI; 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 i2-20020a17090332c200b001ac62935789si24034359plr.468.2023.05.17.11.51.11; Wed, 17 May 2023 11:51:27 -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=kSMgvqNI; 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 S229825AbjEQSs3 (ORCPT + 99 others); Wed, 17 May 2023 14:48:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbjEQSs2 (ORCPT ); Wed, 17 May 2023 14:48:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33528FE for ; Wed, 17 May 2023 11:48:28 -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 BCB0E63D49 for ; Wed, 17 May 2023 18:48:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE443C433D2; Wed, 17 May 2023 18:48:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684349307; bh=0wwL2+NXSkmPfNrLmHdlLeDAx4VxNIV7troyimyoYxE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kSMgvqNIyW74smSyIMZr6dOQQXAsSrCfLV9GC2GllU7IqZY2LERlvM0h4DrOy80lS CQNhX5DMLOC+w5ZXhy0CHWPDvu9UvFfxDg9IvbPHCwH/2Qw18QUqvPX9iN3MvcNKsJ no4UeUK8405fuXOCY8ZSGZmds0zQTTvw/LH8+pW3Jka5uiU4uOrydGRA3OBwOwo6AW kMFZFSafBCqBeav+Fb1KAjHCHfvDP8im+/E81T9Rj5XCxkIl11RdHZ7FMSdG5LtsgM PJgRg9QD9it1cz6vvNEXuGRuqzqSGT3I2+lYlUVN5RQe611M6pozW51WGkxZ/KRCgI LJJLasJpHuNrQ== Date: Wed, 17 May 2023 11:48:25 -0700 From: Jakub Kicinski To: Peilin Ye Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Peilin Ye , Daniel Borkmann , 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: <20230517114825.5d7c85a4@kernel.org> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Fri, 5 May 2023 17:16:10 -0700 Peilin Ye wrote: > } else { > - dev_queue = dev_ingress_queue(dev); > - old = dev_graft_qdisc(dev_queue, new); > + old = dev_graft_qdisc(dev_queue, NULL); > + > + /* {ingress,clsact}_destroy() "old" before grafting "new" to avoid > + * unprotected concurrent accesses to net_device::miniq_{in,e}gress > + * pointer(s) in mini_qdisc_pair_swap(). > + */ > + qdisc_notify(net, skb, n, classid, old, new, extack); > + qdisc_destroy(old); > + > + dev_graft_qdisc(dev_queue, new); BTW can't @old be NULL here?