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 6D1E3C43381 for ; Thu, 21 Mar 2019 14:17:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 335EC2075E for ; Thu, 21 Mar 2019 14:17:13 +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="xnGzO9Av" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728247AbfCUORL (ORCPT ); Thu, 21 Mar 2019 10:17:11 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33445 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbfCUORL (ORCPT ); Thu, 21 Mar 2019 10:17:11 -0400 Received: by mail-wr1-f67.google.com with SMTP id q1so6828951wrp.0 for ; Thu, 21 Mar 2019 07:17:10 -0700 (PDT) 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=/Tnrf3FNoS0xGfw3jfrxDxiV+EX4tg+6DMIVTyhoNqo=; b=xnGzO9AvBzACEiJKgwKF+wF+h2T3EBg5pq73p0IK6v2MibOxhY5aER6hBoKBIAzpBI s4d/feoq4LxnPwwuo1sPLLKtHIaPMR5cdYn4lmMA47seo7ZGKQno1aFABaVoseeud5f7 eGwhQfe5dAMd5NCTdQigNZRNoDYFbSoNKK60mYDR3ZHz9LWJxXv4pjbI9b6AbZ74Nxd6 wjAILi0EpLkxaCGhdDOW8feZ3gmfFkpqUFMVNPpLdmSOBIcmYBKR1xHSQyZIOSBRFbOe NPy3QfzS8B5yAxq3vI//Sm30/JK009VHHunms/t2FcTTLXZU3RnrAjgumMF6x36uhD5o AKPw== 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=/Tnrf3FNoS0xGfw3jfrxDxiV+EX4tg+6DMIVTyhoNqo=; b=CEHcsiHSCCPN1gwhzMJiYDfy1HhF2kSjxJic39kYH/jLMgrkNcwQ+6ot0dEGNt9D7D MjPAQOIWlnRmxaQ+xSKszVCy44oGYTQoeXrKPPxOTVJ1mTBvNzKNvXcVMmcz3gZ3brCd L85r4tzarxjnCWAMtJihUfvCvLL0JKPm+jOPdEdBfBNFTRlJkfD7KWWE19f2kBCL36mh aA2qgRMeIJRy2jj3PA4RUG8ZLdwgjxI605qPkWUL+fnriF53VQaKHSQvOso+aTdw2+uw NU1IXvYzh7w2/DORJ02p+05sn/fmpEM3Jj8o3QSkFvw13YzB8bmxcLAjh36Y6VDJoTbK sJMw== X-Gm-Message-State: APjAAAVcxToxKv63Y9UiVxrivT3JlnXl54YkkB5iETELS3gytcqyuk+Q CtAjZjxIbYt/ymV/sIiK8EBpOA== X-Google-Smtp-Source: APXvYqzLQrCryZ2TmsEZWMXKOw7qebgLIluOEjSnAW7vVIoBPgaJhGb2w9CJMpabpIpGVrb96zXXPg== X-Received: by 2002:a5d:6889:: with SMTP id h9mr2784477wru.12.1553177830000; Thu, 21 Mar 2019 07:17:10 -0700 (PDT) Received: from localhost ([195.39.71.253]) by smtp.gmail.com with ESMTPSA id a82sm5761718wmf.11.2019.03.21.07.17.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Mar 2019 07:17:09 -0700 (PDT) Date: Thu, 21 Mar 2019 15:06:29 +0100 From: Jiri Pirko To: Vlad Buslov Cc: netdev@vger.kernel.org, jhs@mojatatu.com, xiyou.wangcong@gmail.com, davem@davemloft.net, sbrivio@redhat.com Subject: Re: [PATCH net-next v3 09/12] net: sched: flower: handle concurrent tcf proto deletion Message-ID: <20190321140629.GM2087@nanopsycho> References: <20190321131744.19224-1-vladbu@mellanox.com> <20190321131744.19224-10-vladbu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190321131744.19224-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 Thu, Mar 21, 2019 at 02:17:41PM CET, vladbu@mellanox.com wrote: >Without rtnl lock protection tcf proto can be deleted concurrently. Check >tcf proto 'deleting' flag after taking tcf spinlock to verify that no >concurrent deletion is in progress. Return EAGAIN error if concurrent >deletion detected, which will cause caller to retry and possibly create new >instance of tcf proto. > >Retry mechanism is a result of fine-grained locking approach used in this >and previous changes in series and is necessary to allow concurrent updates >on same chain instance. Alternative approach would be to lock the whole >chain while updating filters on any of child tp's, adding and removing >classifier instances from the chain. However, since most CPU-intensive >parts of filter update code are specifically in classifier code and its >dependencies (extensions and hw offloads), such approach would negate most >of the gains introduced by this change and previous changes in the series >when updating same chain instance. > >Signed-off-by: Vlad Buslov >Reviewed-by: Stefano Brivio Acked-by: Jiri Pirko