Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp929045imm; Tue, 15 May 2018 11:12:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrPAu/ChLCuFXZ8XLvvLzTOQEnGy4fuAWL0Uep6Rl25wYqXUDmpFPvVb+hI+dxdlehX64SE X-Received: by 2002:a17:902:7146:: with SMTP id u6-v6mr15283235plm.289.1526407926338; Tue, 15 May 2018 11:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526407926; cv=none; d=google.com; s=arc-20160816; b=kLUy8Jap5ZkOlB1NtNYTGgbVx+C8Td12ZFVu72Yf5POHaVWDxSik1uzajHxcJ96kDA p+uB5O3ZEdPmoYcJrn6H5gDmfsvUj/WQuq8eaBbd35fSrHP4QrX6DWHXoZjKZOMWQE/W Zq4HETiVq1gwV9iImhVBXb2ODGv+lwbSCQODmmoYDE1SepdHEqGwtTjhCAIq5LOtoVUK OAbEEa2g5eanG1D0nogIzsPLRfvfVjIcCGWcJy/V86N3tXxY9AjoYPPY39KZveI5m39V 9z3xqKrgdDe3c+kmC9Yiw+b05YIgVICtsS7M6FHO74bM5gCGROb7zEdP9Tuxk3tfnrcc X84Q== 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=AAC+RjbpinxUmWmAJVg4UYg1JLUNzQcB3nv1yCvzJOQ=; b=c7ECGN4/uYg2FOHWcBGFqK7DtmNRKc6mr2NzTOsVSB2TvsHignGiIpodruKXrgDkgk guk9LpAo68nP5I0/HfOpf+nQPf9FmJy4lPkIK7xq4xgcrTBXsnjemlpOqbW4X/PYf1xf cZ4Mttl7PXnbf4r7cmSSCTGdKxRqKuEbZWqwJSXeFmiKjZtHAo79sLEq3RLHGXTQAdHG NRYr6OGfTS0riv+nan2+R9+pyT8d1Imgs3lTZvXnLMUlZt33p35VbyF7fPr4xYZs08YP DQ/2M/Tb+K07JxKG9kJITDQHoQTNneyBNEJ9SsXwGDI0wKdt7SJBbHMKNG2h6MKPE5YV icIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=BThAJbD9; 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 y23-v6si539034pff.177.2018.05.15.11.11.49; Tue, 15 May 2018 11:12:06 -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=BThAJbD9; 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 S1752754AbeEOSLg (ORCPT + 99 others); Tue, 15 May 2018 14:11:36 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:56632 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751295AbeEOSLf (ORCPT ); Tue, 15 May 2018 14:11:35 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4FI5xEx015960; Tue, 15 May 2018 18:11:14 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=AAC+RjbpinxUmWmAJVg4UYg1JLUNzQcB3nv1yCvzJOQ=; b=BThAJbD9BkXeMw0npsmOeFzhElpTWLf7SWr4QO41iTfT4G+zYB6y2EUrXzCc+LpLpqep Tu+jQt6Wysj7xKjz3j4mFGteXWNULPz8VjOsAn8a+URhli+0C3C8DqBHL2+ThYwPkxXV wV/DwwAMVRA1l/JYsDq0S2glMHQIWRiJRd/sawE5cEF2GOiAS3YyZD2URJSdYeei2ewU FD0R8aUhNZ3J8IRPgxakS+iz/PAFNyEuQRrhHYF3/w+NFBy88jrV6WLRdhypkmx78ON9 WDBRU2n9FwBPrEE8tIWOAVtiVLWpwUfpXlqQhvGTD+0KNf+xLQGjKDa4fMEhk7V7lFWS +g== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2hx29w1m2t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 May 2018 18:11:14 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w4FIBE2U024005 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 May 2018 18:11:14 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w4FIBDv7031531; Tue, 15 May 2018 18:11:13 GMT Received: from dhcp-10-172-157-170.no.oracle.com (/10.172.157.170) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 15 May 2018 11:11:13 -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 2/2] IB/cm: Send authentic pkey in REQ msg and check eligibility of the pkeys From: =?utf-8?Q?H=C3=A5kon_Bugge?= In-Reply-To: Date: Tue, 15 May 2018 20:11:09 +0200 Cc: Jason Gunthorpe , Doug Ledford , Don Hiatt , Ira Weiny , Sean Hefty , OFED mailing list , linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180509093020.24503-1-Haakon.Bugge@oracle.com> <20180509093020.24503-3-Haakon.Bugge@oracle.com> <3bee76df-49a6-cf3c-6df4-749a6309358e@dev.mellanox.co.il> <20180514210200.GN21531@ziepe.ca> To: Hal Rosenstock X-Mailer: Apple Mail (2.3445.6.18) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8894 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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805150180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 15 May 2018, at 02:38, Hal Rosenstock = wrote: >=20 > On 5/14/2018 5:02 PM, Jason Gunthorpe wrote: >> On Thu, May 10, 2018 at 05:16:28PM +0200, H=C3=A5kon Bugge wrote: >>=20 >>> We are talking about two things here. The PKey in the BTH and the >>> PKey in the CM REQ payload. They differ. >>>=20 >>> I am out of office, but if my memory serves me correct, the PKey in >>> the BTH in the MAD packet will be the default PKey. Further, we have >>> per IBTA: >>=20 >> This sounds like a Linux bug. >>=20 >> Linux does not do a PR to get a reversible path dedicated to the GMP> = so it always uses the data flow path, thus the GMP path paramenters >> and those in the REQ should always exactly match. >>=20 >> Where is Linux setting the BTH.PKey and how did it choose to use the >> default pkey? Lets fix that at least for sure. Linux isn=E2=80=99t. The BTH.PKey is inserted by the HCA (hw or fw) = coming from the P_Key table (10.9.2 in IBTA), selected by a pkey_index = associated with the QP. As per C10-133: Packets sent from the Send Queue of a GSI QP shall = attach a P_Key associated with that QP, just as a P_Key is associated = with nonmanagement QPs >> Once that is fixed the rest of the series makes no sense since a REQ >> with invalid PKey will never arrive. >>=20 >> However... >>=20 >> This series seems inconsistent with the spec. >>=20 >> IIRC the spec doesn't say if a full or limited pkey should be placed >> in the REQ (Hal?).=20 >=20 > CM spec for REQ just says partition key without indicating whether = this > means P_Key or just the partition (15 bits) so my read is that either > full or limited pkey is allowed in REQ. >=20 >> It is designed so that the requestor can get a >> single reversible path and put that results into the REQ without >> additional processing, however the PR returns only one PKey and = again, >> it is not really specified if it should be the full or limited pkey >> (Hal?). >=20 > Correct; it's not specified. >=20 >> Basically this means that any pkey in the REQ could randomly be the >> full or limited value, and that in-of-itself has not bearing on the >> connection. >>=20 >> So it is quite wrong to insist that the pkey be limited or full when >> processing the REQ. The end port is expected to match against the >> local table. >=20 > Note that there is thorny issue with shared (physical) port > virtualization. In shared port virtualization, the VF pkey assignment = is > a local matter. Only thing SM knows is the physical port pkeys where > both full and limited membership of same partition is possible. It is > conceivable that CM REQ contains limited partition key between 2 = limited > VFs and for that a new REJ reason code appears to be needed. +1 H=C3=A5kon >=20 > -- Hal >=20 >> The real answer to your trap problem is to fix the SM to not create >> paths that are non-functional, that is just flat out broken SM >> behavior. >>=20 >> Jason >>=20