Received: by 10.192.165.148 with SMTP id m20csp2472744imm; Thu, 26 Apr 2018 11:34:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/MBixRz9xNLvCl+MM8/K7eD93+n2hixzDr691zufPVivpu5sLOryTUTGbHgG2wfPf0RfKk X-Received: by 10.101.91.74 with SMTP id y10mr21127212pgr.243.1524767681481; Thu, 26 Apr 2018 11:34:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524767681; cv=none; d=google.com; s=arc-20160816; b=coGIP8U//QvbqGvSx+W975aDtPT//aLIz86x4kX6LqwT9OWpSc2abbU3wUXYYcH+Bh h465Rxvl1Gci7mDgDxTOgM17B5s1hbE7DBhxn1out8CD87dTh7PJp1N+CC20JC74Vw5B r3hYuhpBnaR8GT032L7GRXV5XdRFfOUTAZ6ZwM/jULLc8cbleIEOeRK57slPVFpgi99J RsVX27Zc4Ti7yRbZY7rqKFpJEMGBK0OT9uorsjf43ndwaQQhMLpDIfTAdU1LDT8K4LZf XcIrD7DY3oSE9G02ebDntAyfsz3BaWuxq0116rVv0+0KFLxfKbvDTp91nJUHg+9GNoFk +cZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature:arc-authentication-results; bh=1jYHvb/KvNeyngsop1+f1XcqMR1bf/whXYBwvJ9mMAM=; b=hkyp1AozZkgJrfHLHwQyii2jMJMrq7gvbZhUCKmNsAJnPI3x3JbYTfngItyKPmczEa DtItZkWBJwcToeuB7FNDBI1gQXBbZpnC5U1Dw3K+LcsHqB6TYSi/VuACdOyIw4FoX7K5 fzEBv4WGohMD3ePQVDg4VzK3ASbBctZUnd6sm8OP5VgvCbUmqRXCNWhZCLMMjKLalXut ehwxtAQ8gYu3alVay79AyTKv5lCxRgwXO3nRYKpaVERk1cqbzzey4e5pqUzVVm4FZHcc wO1Q3suvpjg5C6pZyB5qVgulnXE8PEcnc/LSNTE/xzeMFEiAsp3qUS9a7Wv/CQEESd/E arbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dev-mellanox-co-il.20150623.gappssmtp.com header.s=20150623 header.b=ffPzz6R/; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.co.il Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4-v6si4787550ply.351.2018.04.26.11.34.27; Thu, 26 Apr 2018 11:34:41 -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=@dev-mellanox-co-il.20150623.gappssmtp.com header.s=20150623 header.b=ffPzz6R/; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.co.il Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756798AbeDZSdO (ORCPT + 99 others); Thu, 26 Apr 2018 14:33:14 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:46551 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753830AbeDZScz (ORCPT ); Thu, 26 Apr 2018 14:32:55 -0400 Received: by mail-wr0-f195.google.com with SMTP id d1-v6so57704910wrj.13 for ; Thu, 26 Apr 2018 11:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev-mellanox-co-il.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=1jYHvb/KvNeyngsop1+f1XcqMR1bf/whXYBwvJ9mMAM=; b=ffPzz6R/y3tGoZy7YfrDvGAR/YulDwT85xKYpFOMG54wGJvYxLTRV8pulXpsiu+qrx I0a/+rzz/rvNhLO6yNVvOHE494Huk9ZOOGslMoiLrvIJDNE0LHJ2kF4bLPFxm5NiRpBt vsFYkD7hHjnHCiChU7zeP4Hp9ByRtf1Yg/mVKGE/RuvPP3HlLHErdUIWLlxpHcSBoReA Ke9c0nsQSHVb939ZEHgEVSvW7E6ocTgqlL/qAZN9gvlqak0L13ce40e86n8ox08oFbsx yUcysjazNn30zLDxYTNZY7JHWhw6oi3hCpfil0OXIGFeM3nn31Wq51mjdtgG2AyFs0uC BPNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=1jYHvb/KvNeyngsop1+f1XcqMR1bf/whXYBwvJ9mMAM=; b=F0MKilfrIwDu/0M413MLQHF0tCl1WzmE9OfSHe2NzjhkOvJY3HWlj3NsH9bBiMyvHz 1xHpfX6eKW80wfHzX0czd2IiV3uOtufJq+7H4t8m8l9RVXg3EXBx4D/W2GRgpErt94d6 qqb0L/6TGz0d5mUSvf/E29skK/887XRfop1COCcPz9K+kqJ+A1rjgL4qotGkoLeGCYXD okgomrs3J3vHcYNVKqO+MBEMBloi6/5jtnyIWRnKq0lbZIku1TpP9fUNZQg0uAVlSnc1 sIab5+ayFfT9o9mjTg6QjjBg3pAF5l3F0RR4gLnS0wSbh2fZGmV6yv5suRUYSUIv4KB0 vtUQ== X-Gm-Message-State: ALQs6tDFQsb/uisE7DU7FvKyk8aphVZP6JPcWjIE+aol9CJuS5FNif+E kg47cqF3cY6yKUMGYE5JujQeAw== X-Received: by 2002:adf:8111:: with SMTP id 17-v6mr29837393wrm.109.1524767574598; Thu, 26 Apr 2018 11:32:54 -0700 (PDT) Received: from localhost ([31.210.186.17]) by smtp.gmail.com with ESMTPSA id a129sm2218700wme.34.2018.04.26.11.32.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Apr 2018 11:32:53 -0700 (PDT) Date: Thu, 26 Apr 2018 21:32:50 +0300 From: jackm To: =?ISO-8859-1?Q?H=E5kon?= Bugge Cc: Jason Gunthorpe , Doug Ledford , Don Hiatt , Ira Weiny , Sean Hefty , OFED mailing list , linux-kernel@vger.kernel.org Subject: Re: [PATCH] IB/core: Make ib_mad_client_id atomic Message-ID: <20180426213250.0000515d@dev.mellanox.co.il> In-Reply-To: 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> Organization: Mellanox X-Mailer: Claws Mail 3.15.0 (GTK+ 2.24.31; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 26 Apr 2018 18:06:10 +0200 H=C3=A5kon Bugge wrote: > > 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. =20 > > 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 > > From 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 =20 >=20 > 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? >=20 >=20 Haakon, I think Jason is on vacation this week. Best to wait for his response. -Jack > Thxs, H=C3=A5kon >=20