From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH v3 10/11] net: sched: atomically check-allocate action Date: Mon, 28 May 2018 17:24:58 +0200 Message-ID: <20180528152458.GH2173@nanopsycho> References: <20180527175739.GA3337@nanopsycho> <1527455849-22327-1-git-send-email-vladbu@mellanox.com> <1527455849-22327-11-git-send-email-vladbu@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, jhs@mojatatu.com, xiyou.wangcong@gmail.com, davem@davemloft.net, ast@kernel.org, daniel@iogearbox.net, kliteyn@mellanox.com To: Vlad Buslov Return-path: Received: from mail-wr0-f196.google.com ([209.85.128.196]:35676 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033204AbeE1PZX (ORCPT ); Mon, 28 May 2018 11:25:23 -0400 Received: by mail-wr0-f196.google.com with SMTP id i14-v6so20857621wre.2 for ; Mon, 28 May 2018 08:25:22 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1527455849-22327-11-git-send-email-vladbu@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: Sun, May 27, 2018 at 11:17:28PM CEST, vladbu@mellanox.com wrote: >Implement function that atomically checks if action exists and either takes >reference to it, or allocates idr slot for action index to prevent >concurrent allocations of actions with same index. Use EBUSY error pointer >to indicate that idr slot is reserved. > >Implement cleanup helper function that removes temporary error pointer from >idr. (in case of error between idr allocation and insertion of newly >created action to specified index) > >Refactor all action init functions to insert new action to idr using this >API. > >Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko