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 10929C282CC for ; Tue, 5 Feb 2019 13:17:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D35DD206DD for ; Tue, 5 Feb 2019 13:17:26 +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="jgGmBFAg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729243AbfBENRZ (ORCPT ); Tue, 5 Feb 2019 08:17:25 -0500 Received: from mail-wr1-f52.google.com ([209.85.221.52]:34317 "EHLO mail-wr1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726567AbfBENRZ (ORCPT ); Tue, 5 Feb 2019 08:17:25 -0500 Received: by mail-wr1-f52.google.com with SMTP id z15so1525974wrn.1 for ; Tue, 05 Feb 2019 05:17:24 -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=PA+jn3S4SUYGbvt/UcI4xuy+xdLk98XK7DgPMJgP1mM=; b=jgGmBFAgB+ypjU+N1gbsQmUihWVa8avTfg3p0zw8NDPETovR5GlB6BAQUfB/7ZIR2F FzH4ONBxdoQGyRnAE1UUbkb2uBaPUPhUXiKpXQGtip+L6GJ8sLid8fzK1UncBwz2qcTi xgekZViGiuA5sQequhJN9oliqxVIIg/pCn1Y1PVXqXKfr6C5PO4dR38x1s5YZcfF98CM SxlYHUyE71XgNAsyiDrVQYkFPtIgBRDvm+hUsuv6S+u1Xc9lkqadn42p66FesOlHaozV 2GcJv6MekKwnm/2ugzg1WkIK7qPWIN/NcBgbJn5Pk/mmWA9uJxj165+eVaAXDc0mukJU OzTw== 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=PA+jn3S4SUYGbvt/UcI4xuy+xdLk98XK7DgPMJgP1mM=; b=PXf62Kkr9JWBHk2drgsSXt3aWVE9u5Pm8e1A80FOklT8dQ4RzkkIx5zihJp99CaUXw xvAGkZZoOXFgmOvg/1DzJWhNcLQDI4OwR2l87fnDzMtXbHLrF6CwsrriLh3+EqZiiB+7 rvPUAMrpmbsGWF1ZT66dTJR9AcDUYHH7CVVt/vFlIpqGVxj5oeMC/Jbbo4MDdffNL3/p 9PKhhjJefNTjoJF8wBcmOYj/NV9uQt9BvnKQaLakA7L/RXSEYSFyaRTf0j4lBgpIfqD+ FuF3NBi1DxroDRDtnxiessLiB48kbSbsYpEiQojLmAiAeh2fvaLXBJUC1pE0Bqfp7z24 0O0Q== X-Gm-Message-State: AHQUAuYwFEWHQRtHmZT0C/yDS4nleGPuspFInM1f+i4F/yiCiDbLUiTI o8uMpOQpJ2qrCFDLI7gjlfW6hg== X-Google-Smtp-Source: AHgI3IYv03uhaAuRH8QYnj5JPujyTKuiYriNmE3QjRnye6bVhS1qXRa2HEEngeyZsB5kcGrvcSQvEg== X-Received: by 2002:a5d:4848:: with SMTP id n8mr3493923wrs.7.1549372643361; Tue, 05 Feb 2019 05:17:23 -0800 (PST) Received: from localhost (mail.chocen-mesto.cz. [85.163.43.2]) by smtp.gmail.com with ESMTPSA id b18sm14058778wrr.43.2019.02.05.05.17.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Feb 2019 05:17:21 -0800 (PST) Date: Tue, 5 Feb 2019 14:08:12 +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 09/16] net: sched: refactor tp insert/delete for concurrent execution Message-ID: <20190205130812.GF2133@nanopsycho> References: <20190204123301.4223-1-vladbu@mellanox.com> <20190204123301.4223-10-vladbu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190204123301.4223-10-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:54PM CET, vladbu@mellanox.com wrote: >Implement unique insertion function to atomically attach tcf_proto to chain >after verifying that no other tcf proto with specified priority exists. >Implement delete function that verifies that tp is actually empty before >deleting it. Use these functions to refactor cls API to account for >concurrent tp and rule update instead of relying on rtnl lock. Add new >'deleting' flag to tcf proto. Use it to restart search when iterating over >tp's on chain to prevent accessing potentially inval tp->next pointer. > >Extend tcf proto with spinlock that is intended to be used to protect its >data from concurrent modification instead of relying on rtnl mutex. Use it >to protect 'deleting' flag. Add lockdep macros to validate that lock is >held when accessing protected fields. > >Signed-off-by: Vlad Buslov Acked-by: Jiri Pirko