From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B695C282CB for ; Tue, 5 Feb 2019 09:44:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C66A2080D for ; Tue, 5 Feb 2019 09:44:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="EDPPsvOO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727963AbfBEJom (ORCPT ); Tue, 5 Feb 2019 04:44:42 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:52210 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbfBEJom (ORCPT ); Tue, 5 Feb 2019 04:44:42 -0500 Received: by mail-wm1-f68.google.com with SMTP id b11so2842662wmj.1 for ; Tue, 05 Feb 2019 01:44:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dXvNioDW/ufipPnd/UWsxzpMABTQITd1ZMX94NjQFXw=; b=EDPPsvOOWDsz1qxcUvOwBWxRLysoxDWUiWh+vBf8ktdBTtm3NxLiJjKqoUGdDWMHla SwAPgufnJeO5dO8fTjEMckirtDBDmbj/jiTyg9WuNFa2DgtnfAGFVs+De7w8UzaVWv9E /fqUF2FDYpwOLKX0gWCNQfU7mr7ACM5zPoP2cwgx7mMzg/LW+8VAJkcI7v7WfiElv8m/ bHzWDIEYiPLxVHxxOiZ9vpvo4FYmhpz08rAEz59HRsUYBx1HWHeI8tQeq74sG7BkvKpb Fmrv4HlFV0GoSHJcbmb6TbtP7YROXeHJb5ulezqEnjFXmjP/5mEg4E9FZHae1q1sWVAs QZ9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dXvNioDW/ufipPnd/UWsxzpMABTQITd1ZMX94NjQFXw=; b=LhHQUs7wFp04xCL3fl1xTMKfKVFDtgxIPXoFEujMIN8KsWBNAZhEq7zVmilQ6KIi7Q /S6FHiiNrPo0E0RBTLFtcC4O/OUmL9kidjLOUSrUd0/O8xMk6FPTblN4HDlHK2C3ealG xBgJyLwjc1tTYi5X8YPw08Y/CP3hoPXNUGW4EqXqxqq9uMEDgINUsfU4XRXNLUoZfH5b thWUvtk9WsuFQkgFaO5dMPzXnqD4DfnWTMfEi3xXREGO42Qnwa5JjSs2f7euZJ6W/BAD N3canyKkMEFJzFEx2Yd36+kC1Qr4Ng1bXpi5AJ89cctj3sRF6ZDZu5kDMhoU3VY190Zr pNsg== X-Gm-Message-State: AHQUAuYZaeWUGctfsA64VREBtRp0zi/5lP9fyBFT7RVJqEoYuJYsRXO1 3kT9pqo7aISxoGBUI+oZofO85A== X-Google-Smtp-Source: AHgI3IazmdlU8/JFKKoq3BtgYTdbgMSvvJsPPWG6a5TU2KlmismXYhg9AR8Sxydv5bVKUoSfYviRDQ== X-Received: by 2002:a1c:e242:: with SMTP id z63mr2879736wmg.2.1549359880726; Tue, 05 Feb 2019 01:44:40 -0800 (PST) Received: from localhost (mail.chocen-mesto.cz. [85.163.43.2]) by smtp.gmail.com with ESMTPSA id 133sm20174389wme.9.2019.02.05.01.44.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Feb 2019 01:44:40 -0800 (PST) Date: Tue, 5 Feb 2019 10:35:30 +0100 From: Jiri Pirko To: Vlad Buslov Cc: netdev@vger.kernel.org, jhs@mojatatu.com, xiyou.wangcong@gmail.com, davem@davemloft.net, ast@kernel.org, daniel@iogearbox.net Subject: Re: [PATCH net-next v3 04/16] net: sched: traverse chains in block with tcf_get_next_chain() Message-ID: <20190205093530.GA2133@nanopsycho> References: <20190204123301.4223-1-vladbu@mellanox.com> <20190204123301.4223-5-vladbu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190204123301.4223-5-vladbu@mellanox.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Mon, Feb 04, 2019 at 01:32:49PM CET, vladbu@mellanox.com wrote: >All users of block->chain_list rely on rtnl lock and assume that no new >chains are added when traversing the list. Use tcf_get_next_chain() to >traverse chain list without relying on rtnl mutex. This function iterates >over chains by taking reference to current iterator chain only and doesn't >assume external synchronization of chain list. > >Don't take reference to all chains in block when flushing and use >tcf_get_next_chain() to safely iterate over chain list instead. Remove >tcf_block_put_all_chains() that is no longer used. > >Signed-off-by: Vlad Buslov Acked-by: Jiri Pirko