From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753811AbeE3PKm (ORCPT ); Wed, 30 May 2018 11:10:42 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:35655 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753632AbeE3PK0 (ORCPT ); Wed, 30 May 2018 11:10:26 -0400 X-Google-Smtp-Source: ADUXVKJ5vo1LbRMHMXhgHIg6EirCv1lQx2JlXSDnrAIV7Wg4KJn9sBqwAySntaA9ueJffbSb8SIf4w== Date: Wed, 30 May 2018 09:10:23 -0600 From: Jason Gunthorpe To: Hans Westgaard Ry Cc: jackm , =?utf-8?B?SMOla29u?= Bugge , Doug Ledford , Daniel Jurgens , Parav Pandit , Pravin Shedge , OFED mailing list , linux-kernel@vger.kernel.org, Leon Romanovsky Subject: Re: [PATCH] IB/mad: Use ID allocator routines to allocate agent number Message-ID: <20180530151023.GB30754@ziepe.ca> References: <20180529073808.27735-1-hans.westgaard.ry@oracle.com> <20180529154922.GA18457@ziepe.ca> <20180529164032.GB18457@ziepe.ca> <20180530110216.00000913@dev.mellanox.co.il> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 30, 2018 at 02:22:56PM +0200, Hans Westgaard Ry wrote: > We came up with this code snippet which we think handles both preventing > immediate re-use and too big/wrapping... Isn't this basically the same as idr_alloc_cyclic ? Jason