From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: [PATCH net-next v6 06/11] net: sched: add 'delete' function to action ops Date: Thu, 9 Aug 2018 12:38:45 -0700 Message-ID: References: <1530800673-12280-1-git-send-email-vladbu@mellanox.com> <1530800673-12280-7-git-send-email-vladbu@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Linux Kernel Network Developers , David Miller , Jamal Hadi Salim , Jiri Pirko , Alexei Starovoitov , Daniel Borkmann , Yevgeny Kliteynik , Jiri Pirko To: Vlad Buslov Return-path: Received: from mail-pf1-f196.google.com ([209.85.210.196]:46741 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726971AbeHIWE4 (ORCPT ); Thu, 9 Aug 2018 18:04:56 -0400 Received: by mail-pf1-f196.google.com with SMTP id u24-v6so3301489pfn.13 for ; Thu, 09 Aug 2018 12:38:38 -0700 (PDT) In-Reply-To: <1530800673-12280-7-git-send-email-vladbu@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Jul 5, 2018 at 7:24 AM Vlad Buslov wrote: > > Extend action ops with 'delete' function. Each action type to implements > its own delete function that doesn't depend on rtnl lock. > > Implement delete function that is required to delete actions without > holding rtnl lock. Use action API function that atomically deletes action > only if it is still in action idr. This implementation prevents concurrent > threads from deleting same action twice. I fail to understand why you introduce ops->delete(), it seems all you want is getting the tn->idrinfo, but you already have tc_action before calling ops->delete(), and tc_action has ->idrinfo... Each type of action does the same too, that is, just calling tcf_idr_delete_index()... This changelog sucks again, it claims for skipping rtnl lock, but you can skip rtnl lock by just calling tcf_idr_delete_index() directly too, it is not the reason for adding ops->delete().