Received: by 10.192.165.148 with SMTP id m20csp2322297imm; Thu, 26 Apr 2018 09:07:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx48n7XFnk9qrvZJp+A7cV4hwZEUNOSqWQF7IyjsXY1vDXvYw8Nsj2HdWS8CzdoiWQ3ED3Xbz X-Received: by 10.99.5.69 with SMTP id 66mr18481597pgf.446.1524758834554; Thu, 26 Apr 2018 09:07:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524758834; cv=none; d=google.com; s=arc-20160816; b=tN938ZIZmCg38//MOE5vjEZp0FRPYsyLnyBAYy9PYJuCgKp7xZuHec4LpBX9nuVEps KNcdVmFaGqEVJYYQCZ27u0qGI/991+wXJHpza3+KTdnF2Y1RmcnRxS3Giq5m3m/JOSY9 HpWzXr8ZDHyVvzEcKuI37O7NtUjXLQhHEyMzle9NQU48aoksORYEE9z4lbnBJVBqRK+2 PhvSbhDtS1NTFCLuJGvs2vPk8/7yXqjnCG0I94WQzWlXRkeIhqbrSoyaPASpE1PGgz57 MN/i4XWunNDW0lEzLF591KB/oXeX27GPxHyMcwYBqhM+8rNwRZ1JbosN4F3CSWktolpr Zkbw== 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=m1yFZCMRBnVSrTfXdNxV1pcfJsfeOt4zjTE/mxkhpZQ=; b=nOC1GxhuuOAU3klxGHdTHhgSoO0RV5XGOUAjriVdiT/b3gN6hY2Ad3xP0ElfkPHto5 JdowFIAPjn+loYaUmqTKOA3hpKN6S++HGE9tAGbbpEzyzBq3/03AOmtrP6zY8EwkzppR FJQkLRRmYgSc/c1wZvi8ADdY6Z+Fc354chrqf8hBVEcsBzhN4VDufZcM+bTomJyKioFz iATLMA6awrmkTIMNaQ5EbAapQJ1mAfSVaeOiAk5OB2pHog1SSsZCVZETe6EC1zc1ofMn dWoMPGSbU3wX6v44IxCqTOmj83k6FmmTW/2g9DhMLhOOKLwRTzaycbuvQz9jGReC9ezh BALA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=vZ2o8dsR; 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 y8-v6si20178580pli.242.2018.04.26.09.07.00; Thu, 26 Apr 2018 09:07:14 -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=vZ2o8dsR; 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 S1756811AbeDZQFq (ORCPT + 99 others); Thu, 26 Apr 2018 12:05:46 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:41884 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756519AbeDZQFo (ORCPT ); Thu, 26 Apr 2018 12:05:44 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3QFtp2a161961; Thu, 26 Apr 2018 16:05: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=m1yFZCMRBnVSrTfXdNxV1pcfJsfeOt4zjTE/mxkhpZQ=; b=vZ2o8dsRJ2ytDIEPb+pzJ9jMXkUfphaF9tE3lfbqmasDc008syPBX6fc5AEubLQVJrIC WRqBZbw5mARW1bklUIYarpT/TPOAyLZ5DGOa0564L1GeeRYsjnedc5oskwQorDosfJkN 6OX5cuDIcNJ2IzB2pVAMIamqKXBTJD3jdS5FTgthUXHlB8qc1ungyrkpB8PKQYD3OEH2 dPqDqx/qKH5FAsLUsotu9u/P15HoDl0w4bWKq86RhVNgo/5qB5BnGDhIah6pN6gpD7JV oZkdpwXZwLEidj0DTqRREK/nNeYdFawJS07Ckw6J3jeOdxsGI2L//BLVTDM0yMRxlXS1 dA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2hfw9akypk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Apr 2018 16:05:25 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w3QG5OwG027103 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Apr 2018 16:05:24 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w3QG5NT0018684; Thu, 26 Apr 2018 16:05:23 GMT Received: from dhcp-10-65-163-177.vpn.oracle.com (/10.65.163.177) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 26 Apr 2018 09:05:23 -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/core: Make ib_mad_client_id atomic From: =?utf-8?Q?H=C3=A5kon_Bugge?= In-Reply-To: <20180423221618.0000795d@dev.mellanox.co.il> Date: Thu, 26 Apr 2018 18:06:10 +0200 Cc: Don Hiatt , Ira Weiny , Sean Hefty , OFED mailing list , linux-kernel@vger.kernel.org, jackm Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180418142450.15581-1-Haakon.Bugge@oracle.com> <1524196555.11756.30.camel@redhat.com> <20180420153451.GF30433@ziepe.ca> <50E3FE4A-2C6E-4493-92E1-383C349FAE3A@oracle.com> <20180423221618.0000795d@dev.mellanox.co.il> To: Jason Gunthorpe , Doug Ledford X-Mailer: Apple Mail (2.3445.6.18) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8875 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=848 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804260151 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 23 Apr 2018, at 21:16, jackm wrote: >=20 > On Mon, 23 Apr 2018 16:19:57 +0200 > H=C3=A5kon Bugge wrote: >=20 >=20 >>>=20 >>> This actually looks like a genuine bug, why is it described only as >>> 'confusing'? ib_register_mad_agent is callable from userspace, so at >>> least two userspace agents can race and get the same TID=E2=80=99s. =20= >>=20 >> My understanding is that every lookup is using the {port, TID} tuple. >> As such, it is not a bug, but, very confusing. > Haakon, you are correct (see snippet from the IB spec, below). >=20 > We will NOT have a situation where there are 2 threads/apps > with the same agent ID on the *same port* (accessing the agent ID > allocator is protected by a per-port spinlock). Having the same agent = ID > on DIFFERENT ports is OK. > Thus, there is NO bug here. (But as Haakon says, IMHO it is more = robust > to avoid having the same agent ID for 2 agents even if those agents = are > on different ports). >=20 >>=20 >>> TIDs need to be globally unique on the entire machine. =20 >>=20 > Jason, that is not exactly correct. >=20 > =46rom the IB Spec 1.3, C13-18.1.1 (in section 13.4.6.4 - = TransactionID > usage): > "When initiating a new operation, MADHeader:TransactionID > shall be set to such a value that within that MAD the combination of > TID, SGID, and MgmtClass is different from that of any other currently > executing operation. If the MAD does not have a GRH, its SLID is used > in the combination in place of an SGID." >=20 > Since the SGID/SLID is different for each port, the per-port guarantee > of no 2 agents receiving the same agent-ID value is sufficient. >=20 > -Jack Shall I interpret this silence as my commit is good to go or that I = should add Jack=E2=80=99s tangible information to the commit message? Thxs, H=C3=A5kon