Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4842032imm; Wed, 30 May 2018 13:07:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIzh+FyPc7lpyeSq1dpb0eY2ev1w7df02Ekno+8DXYLntnvKhGvKsc2hSCVcRsWXTcOCCPG X-Received: by 2002:a17:902:b588:: with SMTP id a8-v6mr4058147pls.308.1527710854899; Wed, 30 May 2018 13:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527710854; cv=none; d=google.com; s=arc-20160816; b=zQECqotKETCEUTCi2ZhcUVt/OWvGS/cGMP1xPu4Itsnw2Ep7P+7mvcSjsn+JkuPMkS vyKgXdwkaYW9gRbVa/5YvxAjJvP4IMJvSTQ6fTC431a8whumMMclPI+PdyFhb4T59boz bNo2zyzwxh1q5Yl/YfMO0bOi0oD9M1XPkyIXaGAdI3tJBKnL+Kf5d3JlvShrxVO3XQtO fzprHnHiEy5rZh5UFNuZzKQ9iHWC8Pcum0lQhaO36w4IRtb8vmeND5UZcxNgnAieOFi/ VNBAhh2JZwm6JH2pCwX5PfhpyK2L2basDyeNvm1oTc9RlXfeluIOTemXEvimM3J23fig EsFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=33LLMiMtQZQPn1rB543VamKLC+FxC9TKxijdPM0Wi64=; b=VudCjrPb2HTItXhB6qNu4ZuXOAoNCh3Nna0FGHCpspqPNo3w/MB4U70bkHiN7Iv8+u JGYL2/pa5XLLSFCPIyBO3UxPYwmFgQf9Aw3WNl6uxjo2/gEd01ibIlmDcGbMsX6WMxcM PDsR3YBGUOPr87JrVL2xZ7/V/gp5GKLNaCxuRzNVsvqGb+Rye8DwCFaT6b9CcbAq+55m CgKQ3sYkW2cwSxZHRwaXbFGmkC1SawiUdibXrFn403pb3a1jralqmb4nSlN1eWBC9Sd3 xdVptFZwPKuvkbE5PBfARerjpfRvi+IN716RaAZRL7xYBbPlulloMWeHay8ghX78UieQ rYCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=ElgE+WqJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3-v6si34076889pff.43.2018.05.30.13.07.20; Wed, 30 May 2018 13:07:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=ElgE+WqJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932241AbeE3UGr (ORCPT + 99 others); Wed, 30 May 2018 16:06:47 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:47544 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753718AbeE3UGo (ORCPT ); Wed, 30 May 2018 16:06:44 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4UK6PhX041884; Wed, 30 May 2018 20:06:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2017-10-26; bh=33LLMiMtQZQPn1rB543VamKLC+FxC9TKxijdPM0Wi64=; b=ElgE+WqJWtaXD1wQFAA//W3pQlq2TjtT28h3/9Uhq2oMsMjDv4sJJN38+hmS+R2RQ5XZ tENY4teCmjCU/clQbM1S0pqnrU/bfZHw48HCQDHHsRso/WHyvw61BRWh8LUe3v26R3Yw bz30b8HMSfgf+RsPSW1E0xulHHmXocP09SV9K9fBTUdsWjkILENof/uP8dgUjbimAO5F RSZ57IdvjqJfu2mmiLYp4FW6IyG2MK8IYZj6DhyXcUsjnJZ5bjP3MAsuuQyJpMANuq69 g2l6zHR4eqIkeRa11JWFIejywmkZJpyrBXh9w+wHjzk7x5+RC0jWqvbAHJfIikIJadpz cw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2j9ev8475n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 May 2018 20:06:25 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4UK6NhA021975 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 May 2018 20:06:24 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4UK6L1Q017290; Wed, 30 May 2018 20:06:21 GMT Received: from [192.168.10.196] (/51.175.236.248) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 30 May 2018 13:06:21 -0700 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: [PATCH] IB/mad: Use ID allocator routines to allocate agent number From: =?utf-8?Q?H=C3=A5kon_Bugge?= In-Reply-To: <20180530151023.GB30754@ziepe.ca> Date: Wed, 30 May 2018 22:07:16 +0200 Cc: Hans Westgaard Ry , jackm , Doug Ledford , Daniel Jurgens , Parav Pandit , Pravin Shedge , OFED mailing list , linux-kernel@vger.kernel.org, Leon Romanovsky Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180529073808.27735-1-hans.westgaard.ry@oracle.com> <20180529154922.GA18457@ziepe.ca> <20180529164032.GB18457@ziepe.ca> <20180530110216.00000913@dev.mellanox.co.il> <20180530151023.GB30754@ziepe.ca> To: Jason Gunthorpe X-Mailer: Apple Mail (2.3445.6.18) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8909 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=3 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=3 mlxscore=3 mlxlogscore=158 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805300214 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 30 May 2018, at 17:10, Jason Gunthorpe wrote: >=20 > On Wed, May 30, 2018 at 02:22:56PM +0200, Hans Westgaard Ry wrote: >=20 >> We came up with this code snippet which we think handles both = preventing >> immediate re-use and too big/wrapping... >=20 > Isn't this basically the same as idr_alloc_cyclic ? I draw my statement back. The idr_alloc_cyclic() is the family of idr's = that associates a pointer with the bit. Hence, each bit is a bit + 64b. That's why we ended up with Hans' pseudo code. Thxs, H=C3=A5kon >=20 > Jason > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" = in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html