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 52AC3C282CB for ; Tue, 5 Feb 2019 10:13:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BFAC2145D for ; Tue, 5 Feb 2019 10:13:29 +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="L/WiorKH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728332AbfBEKN1 (ORCPT ); Tue, 5 Feb 2019 05:13:27 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45389 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727039AbfBEKN1 (ORCPT ); Tue, 5 Feb 2019 05:13:27 -0500 Received: by mail-wr1-f65.google.com with SMTP id q15so2885703wro.12 for ; Tue, 05 Feb 2019 02:13:26 -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=0myP8QgRYzuoGNtQQXhLJDoe/lF00Zu78wFOoF/yT7w=; b=L/WiorKHUIfHetqXDJ+SfvTteFupvsAO5RUUKKeXnkuUwooGyhNL3Ag551SKKheo8m RPsELX7LdRbYXdObuUlw00+uTyPMFe5RPBaJFCEhBm/8BjXMjSQk/9geEv5CHO9oxaFA VU4QVyXwdzilZIYVKLhyXATd9GPAKyn2xY1vq2WcJawdcrQPwOdUBC/29N+eJV9dSze2 VTtDsyDVAfOmTHsZlakS8fiVBcPBsE+2cKR93Oafx3VTzQR8duYN97d9Mxy9DavAnqrt 7DBG03wnzRq+fuQ0D9WsUfXP4H0MjfRq+3Qaom3wi6M9jU0Tezpx/4dFwOkkqW2MX08o a5Bw== 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=0myP8QgRYzuoGNtQQXhLJDoe/lF00Zu78wFOoF/yT7w=; b=lySAmZNluLKoRBTMxM83AGswtU/4uJanIRCrnu3jQ2j1+HpnSvBw5a17wRptfwu/d2 JHV3tK471VhxiNKGrEGH/Ubee8LxLlOizIDxmgPaj8oNqarfbV2qhclAaqctHtt3caZg 71e9PLopAv6JKsKLTNO/ogq0WvviIokTUTatQLkZe0CFfufk/kduFV7HuYdoOCwwZwnR H81VMJPSKzr3RRXj0JFYoxb4CdoisRQaRav+voaRQoQ0AsnSgn5TktpweHcWCcYZ93+0 MjYYAQeFuk2A9df8JvyiSx+nqek81oePqGjHRihsa0nDeOAr/3q/UlXx+4u7utGcdRXg 1nbQ== X-Gm-Message-State: AHQUAub+sCHlgx6AA9xE/rk1L4njB3pf8EtgPkZmdj9FMtgZ1aGtCiL6 Hs3SfZpKX36oaB0nqnTXWVfboJ4JtbM= X-Google-Smtp-Source: AHgI3Ia/R2J+a8fs5FlvFug1B8lwP2mE4nEqnWf4Rmpy85kv/2ikjW5mHcdbA+8cr1lFDG8jce+D5Q== X-Received: by 2002:adf:bc87:: with SMTP id g7mr2957409wrh.250.1549361605683; Tue, 05 Feb 2019 02:13:25 -0800 (PST) Received: from localhost (mail.chocen-mesto.cz. [85.163.43.2]) by smtp.gmail.com with ESMTPSA id 133sm20279768wme.9.2019.02.05.02.13.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Feb 2019 02:13:24 -0800 (PST) Date: Tue, 5 Feb 2019 11:04:15 +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 06/16] net: sched: protect filter_chain list with filter_chain_lock mutex Message-ID: <20190205100415.GC2133@nanopsycho> References: <20190204123301.4223-1-vladbu@mellanox.com> <20190204123301.4223-7-vladbu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190204123301.4223-7-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:51PM CET, vladbu@mellanox.com wrote: >Extend tcf_chain with new filter_chain_lock mutex. Always lock the chain >when accessing filter_chain list, instead of relying on rtnl lock. >Dereference filter_chain with tcf_chain_dereference() lockdep macro to >verify that all users of chain_list have the lock taken. > >Rearrange tp insert/remove code in tc_new_tfilter/tc_del_tfilter to execute >all necessary code while holding chain lock in order to prevent >invalidation of chain_info structure by potential concurrent change. This >also serializes calls to tcf_chain0_head_change(), which allows head change >callbacks to rely on filter_chain_lock for synchronization instead of rtnl >mutex. > >Signed-off-by: Vlad Buslov Acked-by: Jiri Pirko