Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3562849imm; Tue, 29 May 2018 09:17:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqL7AMJnfS/hilFd+fGIMCjy0itit95hxQ5ALWcCMKXQuH4xZwBHyvU1rl8NAA36ConWlCa X-Received: by 2002:a63:3c4c:: with SMTP id i12-v6mr14392342pgn.309.1527610666851; Tue, 29 May 2018 09:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527610666; cv=none; d=google.com; s=arc-20160816; b=tl9SWcAopW52UkzcIHl1bg4klKrhA4WQY1TYePvv8uGBNoNPyDhtY1d5H0/cxmtmjM OnHoGJsnotAb1jSmmTwUFnGLdht8aSgSXT9ymQ3Tugq/bmWBSrSZEfpfoUtaSfJdebIj UsubR0kXfb06SZUeSoRRRvTYdymnDX7+8bOrC1AWLCoWjsCBMmTdCfLZspJ6Yd+5SLUW uXukabK2TBlcJ2a3xro19IoBM7B5L9cRb5sHQ2810lGoc952w00kig0Vc+/gaCj9pNEl 2FqMxtb6dMFiNs+MCwfONIVZLTK9XSTBfe7zWk3w2LiMoWQS930TSI+xfDV4lbFR2D1+ zc1g== 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=Q0wt1QHsHX47/8EL+FQ5s5II+p1Yx84j1F5p6oWvpcs=; b=TMRpmg/oVtytPImN19+ij445yqgSKoRRh7eg+m6AWKtGw+Sdve0Fq7+i2BOWp1ivNP NfJem+s+AGXoOzkwSQHDI2nAamcg4ga6crTGozXgRXAVd+APjfdatBtGdX7RgdxqM4e1 xc+zc58BprzwaSa0IgHPSc7uv1LT3FFdqTsbI1+rr/mJdE+DQ6m8tHBFAugLUNlpj9v0 xz5v1i+oMlCqp54z22v2eq8UnVtU4LA+NmOioNVxNSdJMr/bnYiCePuX5iUtRgQA0VPi JBPsse1avabOzKxcRw75VlSKZR3+OjCaZ6c8z0HhFmjccBcHhYpvBo4nn42V1eB5Gl4g mcYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=AXOolj+I; 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 v6-v6si33634019plp.60.2018.05.29.09.17.32; Tue, 29 May 2018 09:17:46 -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=AXOolj+I; 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 S965170AbeE2QQq (ORCPT + 99 others); Tue, 29 May 2018 12:16:46 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:58562 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964848AbeE2QQo (ORCPT ); Tue, 29 May 2018 12:16:44 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4TGFZOu012217; Tue, 29 May 2018 16:16:26 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=Q0wt1QHsHX47/8EL+FQ5s5II+p1Yx84j1F5p6oWvpcs=; b=AXOolj+IcfcgOvQLr6/Y5X7hOtVptzLFqh6nz3fFXRA5hP3VAmlbKy6K9eUsOzFYCp2Q rYUTE7ectC82ucqqGUgOfo+PEi7EWZR66OZAM9pIjI1yQh4sDLsT9xUGOmC0fT+qhrim ptybvM8PZeUAhdgJaKBh6Q1fa8cIJpPK+0TKaq42QqZsNPQ8VSeSZ8cWk5yhUywQ0aB6 NcIwlOCljOpV3hHpmjTogyOh21jpLAUp20Qm+i+Oo51h9qAVwnr/zZtgFLY1i4Rq1GO6 lUbjofjWY3Oo20y/zOTKbI018rtzXLossV/Q6FZ/h+eq63c0WDHOnijIOoa4QtAJ4a5L jg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2j6w42j99u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 May 2018 16:16:26 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w4TGGPon018881 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 May 2018 16:16:25 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w4TGGP7O027401; Tue, 29 May 2018 16:16:25 GMT Received: from dhcp-10-65-154-150.vpn.oracle.com (/10.65.154.150) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 29 May 2018 09:16:25 -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: <20180529154922.GA18457@ziepe.ca> Date: Tue, 29 May 2018 18:16:14 +0200 Cc: Hans Westgaard Ry , Doug Ledford , Jack Morgenstein , Daniel Jurgens , Parav Pandit , Pravin Shedge , OFED mailing list , linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180529073808.27735-1-hans.westgaard.ry@oracle.com> <20180529154922.GA18457@ziepe.ca> To: Jason Gunthorpe X-Mailer: Apple Mail (2.3445.6.18) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8908 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=15 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=906 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805290179 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 29 May 2018, at 17:49, Jason Gunthorpe wrote: >=20 > On Tue, May 29, 2018 at 09:38:08AM +0200, Hans Westgaard Ry wrote: >> The agent TID is a 64 bit value split in two dwords. The least >> significant dword is the TID running counter. The most significant >> dword is the agent number. In the CX-3 shared port model, the mlx4 >> driver uses the most significant byte of the agent number to store = the >> slave number, making agent numbers greater and equal to 2^24 (3 = bytes) >> unusable. >=20 > There is no reason for this to be an ida, just do something like >=20 > mad_agent_priv->agent.hi_tid =3D atomic_inc_return(&ib_mad_client_id) = & mad_agent_priv->ib_dev->tid_mask; >=20 > And have the driver set tid_mask to 3 bytes of 0xFF The issue is that some of the mad agents are long-lived, so you will = wrap and use the same TID twice. Thxs, H=C3=A5kon >=20 > And no sysctl. >=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