Received: by 10.192.165.148 with SMTP id m20csp4524714imm; Mon, 30 Apr 2018 21:39:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqI/o++wJ5UIxMSrXquNYUMvmbAsnKzLN91rboWGmJpM7PPgw9Yn0U4xDA+L/DLMKrtHHoD X-Received: by 2002:a63:6706:: with SMTP id b6-v6mr11922448pgc.214.1525149541582; Mon, 30 Apr 2018 21:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525149541; cv=none; d=google.com; s=arc-20160816; b=mDvNJTx5bKXzJwkoT7vp4oc7CdarqQJHjerIBqGgIyepcJw3KNtlt7DB1J03RmvqL3 WOHWYf5HuHG7bhM72gU4VnMADkK6buboWsv40eqnEz6y7TfpChBijfB3oJWHHF6fadcz LMiZ4HidL6TUm/eajHccHvr4VEV9Y0VFfCoFt+I+KgkK9albxtrnCAFA5iQQrMJD+YT9 iSCf+aiftf0UPEIVgOjJaXrsPs9nytZhhpCgvprmsNwiM9HMF/pp1y1fgQV42IjEEk8C 82HbmDCGE5OWVQYb138EQW/BiR0rTca1dc6nRFGSC95BofXAvsrjF74KHEBXRJL2dnoU zjnA== 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=kRFX9sMoD0dQyFlleHMKvBPrAxxFLDlXEMKn2E8Gylo=; b=kM+Vnt/mxeXTzAVnv+Y+VPfX8G9cDWW5gNxswjIa/a70VGFxnM029BWZTmCz0Irglu U8parkjmPgJA6ja3dfqKnqAogLp3J3Tb7AUlDFmAAOmiqZrQ1ZOMHED+CM8PL61PcSXt RXeD2wUGkShU+6DHLVT+kFFWVLeLI6BX5VFy4sYFEQ+tzeRWe9whjn7WyI8dsf5016Tw qGnjtEcBDgI5uEHBTXkf9Y7tBhDWX6+ltgqpVn13evRdMRkInCLVCUBv60R6vay0UaiM 30/Mj1OYTTsRDjeDo9bFWeapwMaPMJfRNhpaSoDs49FooxsdStieUn3zYVq1QMZImkp6 +dVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dev-mellanox-co-il.20150623.gappssmtp.com header.s=20150623 header.b=ltQ+btvL; 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 a189-v6si490803pgc.296.2018.04.30.21.38.34; Mon, 30 Apr 2018 21:39:01 -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=ltQ+btvL; 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 S1750999AbeEAEiY (ORCPT + 99 others); Tue, 1 May 2018 00:38:24 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:50365 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750817AbeEAEiW (ORCPT ); Tue, 1 May 2018 00:38:22 -0400 Received: by mail-wm0-f65.google.com with SMTP id t11so16320920wmt.0 for ; Mon, 30 Apr 2018 21:38:21 -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=kRFX9sMoD0dQyFlleHMKvBPrAxxFLDlXEMKn2E8Gylo=; b=ltQ+btvL5reY1QkuTkZtwmbfVSyKhF/mUDXg7as+EzlsN6DNW1OrjwIOU4wd4s6e9K +n6TuSYUH5UYk6BWtvQeu0XbmJe3Wn5kGGpNWhIC/zccuFfKU/VD0k6BEhS4m30LuZso x1mp8k95yjzJuUMA3B8JR5LEKhdNJAggkVsNO3Si4k6jxqLBhDFFKKX0TtQOcihAP1LH jNt2D1p5I3Z6Na8U1TySz1oNNoFfOeCbZT267dJWpMGhBj8v8QXG7zC35aE7/QOE8New CcjeWuAWWRzcgA4o1WyGeNhg8+oWsbsDpQWK3maJzRcVKc9ifdvjCqjBLjzySNN7juOy PsfQ== 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=kRFX9sMoD0dQyFlleHMKvBPrAxxFLDlXEMKn2E8Gylo=; b=NTSveH8+Z0p0XOuI4AJFdHm5S35YvqR6bpfDMDm/2vGvWKX25Y8MJSZQEQ3vVmaP+p wj0Ssl+nX1ffihJLMl0T1h5aUJZJzO2RrPQtkOPwGr+1LtABY8g8OHtEcHFQCHyF4wC1 DyZxlaBFcgxaiYiIRnIWhwSvJUylybYTLsnji4Dd6HqTaVgR3sHssBY2W6P7lfoT+SMd NnWPhAWND/ERhuAtJbL+UnZZ7eNaevLeiW0RcLDunLDTkYOycbQtsgeZLU/ddD4F5QbE ck0ro0H2DxTqROnwG/fNLJNLm2uCAsP4BhQaHzDKHPWfH7zugM4qHA+hdOCsIDn5MCqL VSng== X-Gm-Message-State: ALQs6tD9g8W+IRF1KK2hqIKun4etTdy4Rp0TmDjJQH3ffOsAIkQ/KY+V qEVma/H1olfSWZs55sFCnqn+fg== X-Received: by 10.28.51.201 with SMTP id z192mr7779434wmz.147.1525149501096; Mon, 30 Apr 2018 21:38:21 -0700 (PDT) Received: from localhost ([31.210.180.46]) by smtp.gmail.com with ESMTPSA id 137sm4168701wmk.38.2018.04.30.21.38.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 21:38:20 -0700 (PDT) Date: Tue, 1 May 2018 07:38:16 +0300 From: jackm To: Doug Ledford Cc: Jason Gunthorpe , =?ISO-8859-1?Q?H=E5kon?= Bugge , Don Hiatt , Dasaratharaman Chandramouli , 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: <20180501073816.00001ec6@dev.mellanox.co.il> In-Reply-To: <1525108249.11756.93.camel@redhat.com> 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> <20180430144930.GB26895@ziepe.ca> <1525108249.11756.93.camel@redhat.com> 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=ISO-8859-1 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 Mon, 30 Apr 2018 13:10:49 -0400 Doug Ledford wrote: Looks good! -Jack > On Mon, 2018-04-30 at 08:49 -0600, Jason Gunthorpe wrote: > > On Mon, Apr 23, 2018 at 10:16:18PM +0300, jackm wrote: > > =20 > > > > > TIDs need to be globally unique on the entire machine. =20 > > > Jason, that is not exactly correct. =20 > >=20 > > The expecation for /dev/umad users is that they all receive locally > > unique TID prefixes. The kernel may be OK to keep things > > port-specific but it is slightly breaking the API we are presenting > > to userspace to allow them to alias.. > >=20 > > Jason =20 >=20 > Would people be happier with this commit message then: >=20 > IB/core: Make ib_mad_client_id atomic > =20 > Currently, the kernel protects access to the agent ID allocator on a > per port basis using a spinlock, so it is impossible for two > apps/threads on the same port to get the same TID, but it is entirely > possible for two threads on different ports to end up with the same > TID. =20 >=20 > As this can be confusing (regardless of it being legal according to > the IB Spec 1.3, C13-18.1.1, in section 13.4.6.4 - TransactionID > usage), and as the rdma-core user space API for /dev/umad devices > implies unique TIDs even across ports, make the TID an atomic type so > that no two allocations, regardless of port number, will be the same. >=20 > Signed-off-by: H=E5kon Bugge > Reviewed-by: Jack Morgenstein > Reviewed-by: Ira Weiny > Reviewed-by: Zhu Yanjun > Signed-off-by: Doug Ledford >=20 >=20