Received: by 10.192.165.148 with SMTP id m20csp4015956imm; Mon, 30 Apr 2018 10:11:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrd7gtcGVxOxBRR9RoLteDGGsrG6nW+UaAC8tHXLq8Zc1fqhIKol7Bi5SC7plAUW1k8Ubvk X-Received: by 2002:a65:5d0f:: with SMTP id e15-v6mr10862700pgr.119.1525108278113; Mon, 30 Apr 2018 10:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525108278; cv=none; d=google.com; s=arc-20160816; b=lXyfOxFbikVui6ubMJ8wSFJv6hvO8bHgKZNdw3KJ1Gj3cH2uxzmBsJAdqdtPFUQrzX N4p9UpJM2d+8Io2jPfTjWCVzYrNP9fOoX6u16TziKTCwLt0AYJ+GdmqLtQWlMdxJ7Mq3 AoZEMRA3Aj7ClIuBH1MikZQ/M2cQzyZmzSl17Mic1OV0TFXkH+7UF0BJIWtGLgFFICZe /lzmDU7QSenySaEUptGckuhWt60rXe+v9OBMplX4xrYN1ilVk4+2NQz1x0GGGmX73Aoz p3MK7pOrKghzBrXyypZWwJ8RFkIBkCUvQ4YbAk6zAs0Shk4hojlkuxLPqfTFk4LqNRKK 2qqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:organization:references :in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=QSZdTl0oEHrlhp64h912izFurmYGKQrFUk2XBBQr/68=; b=PHR7iqqZI2oHJRHbXoaKWnkjplc7AASb3T2YjXSlEsQvblq6SxyM815wPDhTsa8WRJ kHERIC4k97WGeZzvBLeikXdVPjNGbyFsx/BN/cm33u9J6dJd9Rh3gLH1SVDNz3WdOmgY 7oCIKKtZtl3fwGByaDjnrG9Vj26Z5HG3H+o6Izxok2eer3gjHld0nGYwT9NXX7G0BHRm WJgELVsRF3i6DSt1xTN/EPHDj0A13CAM+2MHKlNMA3ZIYcfVUM47huL2MEqt8gld/XfS G+7YlUZXitypXPjHqQ4rZ3aajXfZQ6NBmU7dlTYck0YaaKEZTC5yfSI9hwghj3SS95c2 7DDQ== ARC-Authentication-Results: i=1; mx.google.com; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3-v6si7445531pld.309.2018.04.30.10.11.03; Mon, 30 Apr 2018 10:11:18 -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; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754936AbeD3RKw (ORCPT + 99 others); Mon, 30 Apr 2018 13:10:52 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46122 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753508AbeD3RKv (ORCPT ); Mon, 30 Apr 2018 13:10:51 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CD2184023335; Mon, 30 Apr 2018 17:10:50 +0000 (UTC) Received: from haswell-e.nc.xsintricity.com (ovpn-122-18.rdu2.redhat.com [10.10.122.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 37ED37C54; Mon, 30 Apr 2018 17:10:50 +0000 (UTC) Message-ID: <1525108249.11756.93.camel@redhat.com> Subject: Re: [PATCH] IB/core: Make ib_mad_client_id atomic From: Doug Ledford To: Jason Gunthorpe , jackm Cc: =?ISO-8859-1?Q?H=E5kon?= Bugge , Don Hiatt , Dasaratharaman Chandramouli , Ira Weiny , Sean Hefty , OFED mailing list , linux-kernel@vger.kernel.org Date: Mon, 30 Apr 2018 13:10:49 -0400 In-Reply-To: <20180430144930.GB26895@ziepe.ca> 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> Organization: Red Hat, Inc. Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-fsORuf+usU5/Vibvb5vC" Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 30 Apr 2018 17:10:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 30 Apr 2018 17:10:50 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dledford@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-fsORuf+usU5/Vibvb5vC Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 > 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 Would people be happier with this commit message then: 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 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. Signed-off-by: H=C3=A5kon Bugge Reviewed-by: Jack Morgenstein Reviewed-by: Ira Weiny Reviewed-by: Zhu Yanjun Signed-off-by: Doug Ledford --=20 Doug Ledford GPG KeyID: B826A3330E572FDD Key fingerprint =3D AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD --=-fsORuf+usU5/Vibvb5vC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEErmsb2hIrI7QmWxJ0uCajMw5XL90FAlrnThkACgkQuCajMw5X L93grBAAlcuVjyVohByp3vHuSNDyjvMn66qPcY9XMiAejp0N6xIykq/7ztLkqtqm PNj0fYEVbUfGKdueMz6SWFVf/dMHtZMuWrYZ18cG6nuRsO/UfHDfvDM/acIKXUPE bTGnZIsa/jqFmLPYW0at0+ww54aAZXchYlWgM24pWBdeqWDx+jVtY7XhGpzE1g/8 5byLP7VP9wkrSyI+ozhXpUOxJrH2mdUqB7an9WiuFt4TZjd1seEchYp+ywlavX8+ wAxpLhP+leQcV3hFI1fgGfKaK0VrjWUfGho2GGuHlaCmKnXqUthEWs9cnms/k+I9 R/hsipt3ZtOfesfkfYFgzqAjLyPj8qikphWVd0/qdHv4W1cKrplpnMNv+pkPSSyc DVzzh1FaJF8TUTzBlTQdSL+L/nL50+b2ROJeOoGK/7lbOL4aH78ltf9j4TogC+Do myHoC6V1SI5/0xHsl39ZSEdAGX95Ou3CAd+JVVScHiGwvZbTR1q1B6nxZDadXJlM k0HGufN8L0IIldQKIsITCxmFG98hgJgu9EgWUVPQuHomdAnkiatr7SuRYYkkNdAj V91qHAs6O/nq8zr+EYL7iTRhYFPeqY3HakNWBgBeJh/+lbyOfFeHhFwTYG0/X26b bJL+uziVG7mwZUMNsAGolqo4Yi+yfoVLUFMu4UPvRcThCfIIKMM= =Mwa9 -----END PGP SIGNATURE----- --=-fsORuf+usU5/Vibvb5vC--