Received: by 10.213.65.68 with SMTP id h4csp2115538imn; Sun, 8 Apr 2018 20:06:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx496pCZJpiPqtqS8LV5cDlGX5la7UCqWwmMR+aqd3/ZcYYWIGMzubpror0Uh9NW3hfvuSwfS X-Received: by 10.99.115.84 with SMTP id d20mr23859973pgn.362.1523243170197; Sun, 08 Apr 2018 20:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243170; cv=none; d=google.com; s=arc-20160816; b=PpiPdv+KFo17mRd/7OTOCxDg/TNzb47WfYKn9U3nelr7YyjLFqLh6ZecSD7uV4PS+z gVTlAZIkQjotfzLxwL6GLsjPm78La9l4j2BxWHC5piMFF2JfW6HmXEfXEZXauIBjo7r0 0885i5vmb5Nf9PndWhz7FuH8hNeJOE0Vw8tbilsOQL9UcDIUpMDo96Sx7qMt42hUVe3X XVqJ+393RhDPc+R8bO0oaKUTU5LKFwvyTyXUAsALqmOdvbR+KIrAvHomct6gqZH3aSgH VMD/lEdjRZbAJcbcwuHRuyc7QmI3pAJAMCYn5XiWs9WgWoF9kgr1l4u8/u1CQoOUz9fk iO4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=GjWGL5IhGsNewobI5DImcoVHlCkQxO8f1Cl8wCWSUiQ=; b=dX8sf4ICP/1CBwapWDA1jVbrfrty/tgA/buhbfABzcly6bh2jCzLP7/E9UNvwxt/K4 rqNQyy4IgfySKBy1Bf6ArmIQkq31Ad0qGqD9qlvcE+N7vvd8OJ2BbUwYrBAmaBsZCaxM 4/2So8FwujCzHhmeMho8cV2/YqtgjM6btsSfkPYI7VTw/jux47wkZSrd85XgACWRBa1q fkgk7CyQQUhKPaMkBwp7qRfSutz8zbngDKhdXzh1q4v51yhBYVaGa6hzcQSAzx81CbAj TVMSzybtpgI81rKb163i5YVt6gbxpoC8dC3Huu7Gr/FHaB9Rz8vAZQ98dXrA9uqxHu2T YBSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=fXH9N0HP; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o13si4487753pgs.830.2018.04.08.20.05.33; Sun, 08 Apr 2018 20:06:10 -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=@microsoft.com header.s=selector1 header.b=fXH9N0HP; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755142AbeDIAZA (ORCPT + 98 others); Sun, 8 Apr 2018 20:25:00 -0400 Received: from mail-sn1nam02on0136.outbound.protection.outlook.com ([104.47.36.136]:19528 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755111AbeDIAYy (ORCPT ); Sun, 8 Apr 2018 20:24:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GjWGL5IhGsNewobI5DImcoVHlCkQxO8f1Cl8wCWSUiQ=; b=fXH9N0HPIlck8X78DkWXpwl6n9R7fO07qQ0SjARVC6TP777H8wIBRhVu4/BjieEn3nM4odQGbCWcZYkr8CfTo3o2JG3Yz1CUDycTMM99NN2oBSj/DHcKxWeQWompR3vsDjvND5cGFe91RYaxObN2Ou10e/8eQtSXm/DdbxPw9eU= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0983.namprd21.prod.outlook.com (52.132.133.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:24:49 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:24:49 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Don Hiatt , Sean Hefty , Dennis Dalessandro , Jason Gunthorpe , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 111/161] IB/core: Map iWarp AH type to undefined in rdma_ah_find_type Thread-Topic: [PATCH AUTOSEL for 4.14 111/161] IB/core: Map iWarp AH type to undefined in rdma_ah_find_type Thread-Index: AQHTz5iwZgsn9AY9xU+yc6uUMLtOSA== Date: Mon, 9 Apr 2018 00:21:23 +0000 Message-ID: <20180409001936.162706-111-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0983;7:Y1u5T5n9zuhZWaEkMZfoq0QU8hZ3M5C762EpKhm4LBKsvwBYg7byarNJTP16jt2JYjSaKK7227ONHdxjX7IbUmqfoPHJv2cWcTtYbGZFlj4CNqQ8m4oZpWczSRhetXQ3q7YQws/BYjdeNMCJnTg0aAE27DYwAwbo8QkfmySlK+y7Pq8cEh+iMoZq2rWiTy4ZowwUO/5M7lKfB42WTEjEIyEVZKWeI13arKb6PJufyyKrSbk+HWz/pU47lfprAZ6S;20:gWCFR8BGXMjCJ5oKGpQlvioNHhhafxcwfemVUrZxozsf0Ia9Y8SHFR/jS30txMN3rVBFbe868c365hhpfmDFFRdCuVXwd3L2pqMb4qYfgKagfBlg1jeV8VSTVMaqjwZiVjQ1rPz8vb3SONR6m06yX1gSWJPxMsvMXx95+w1xIv4= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: bcfb6722-0a74-4a5d-8ac2-08d59db04e3c x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0983; x-ms-traffictypediagnostic: DM5PR2101MB0983: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0983;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0983; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(346002)(376002)(39380400002)(366004)(199004)(189003)(478600001)(72206003)(10290500003)(3846002)(102836004)(6506007)(6116002)(25786009)(6436002)(66066001)(99286004)(54906003)(86612001)(6666003)(105586002)(53936002)(76176011)(316002)(486006)(7736002)(22452003)(3660700001)(86362001)(97736004)(106356001)(575784001)(8936002)(110136005)(5660300001)(11346002)(446003)(81166006)(81156014)(2906002)(8676002)(2900100001)(1076002)(476003)(2616005)(10090500001)(6486002)(107886003)(36756003)(4326008)(2501003)(68736007)(186003)(305945005)(3280700002)(5250100002)(6512007)(26005)(14454004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0983;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: aNz0sHU0OnScnOAoSOQa/bIMumWjVDC5TF3na5KmTiV1NBo+sa3kxRhS8GzK3Z+IlBTxHmS0w+AHDv8OGuSDqGGCT9kxhTUlE2xPeBE8e7+7tfXZ1FLXa+MFd6uSMtdaGEXG8bVnzYniYwE+mbBVtMDclp5JNz911+EPQRmH5Ik+J8+wVLI9USm3LA26Js5cH5YBsT3nFYH4XQyMUPj6JkXLqiiTDQWxcLj/7pJpfG+qF3IBmuyWPXWiPZS4kDqyCmqxQt4ZIy5YtZiIpf4wsjDtBepQmdNFpkNF0aTT/AF92MHjRjXQESw1ryb6rSKKU5sZAIPtq7GTJTIOO+R6zJwtPTlJ40JHnz82D0EPUqs2mZpU0gW4dXYfoJVLBNic9F8sP3qqaH6u+4Qldgq4WTeZjqGQobNG5d3Y5Mj3SRw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: bcfb6722-0a74-4a5d-8ac2-08d59db04e3c X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:21:23.2218 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0983 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Don Hiatt [ Upstream commit 87daac68f77a3e21a1113f816e6a7be0b38bdde8 ] iWarp devices do not support the creation of address handles so return AH_ATTR_TYPE_UNDEFINED for all iWarp devices. While we are here reduce the size of port_num to u8 and add a comment. Fixes: 44c58487d51a ("IB/core: Define 'ib' and 'roce' rdma_ah_attr types") Reported-by: Parav Pandit CC: Sean Hefty Reviewed-by: Ira Weiny Reviewed-by: Shiraz Saleem Signed-off-by: Don Hiatt Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- include/rdma/ib_verbs.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index a9fae49a1883..08f3d8699a27 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -866,6 +866,7 @@ struct ib_mr_status { __attribute_const__ enum ib_rate mult_to_ib_rate(int mult); =20 enum rdma_ah_attr_type { + RDMA_AH_ATTR_TYPE_UNDEFINED, RDMA_AH_ATTR_TYPE_IB, RDMA_AH_ATTR_TYPE_ROCE, RDMA_AH_ATTR_TYPE_OPA, @@ -3762,17 +3763,24 @@ static inline void rdma_ah_set_grh(struct rdma_ah_a= ttr *attr, grh->traffic_class =3D traffic_class; } =20 -/*Get AH type */ +/** + * rdma_ah_find_type - Return address handle type. + * + * @dev: Device to be checked + * @port_num: Port number + */ static inline enum rdma_ah_attr_type rdma_ah_find_type(struct ib_device *d= ev, - u32 port_num) + u8 port_num) { if (rdma_protocol_roce(dev, port_num)) return RDMA_AH_ATTR_TYPE_ROCE; - else if ((rdma_protocol_ib(dev, port_num)) && - (rdma_cap_opa_ah(dev, port_num))) - return RDMA_AH_ATTR_TYPE_OPA; - else + if (rdma_protocol_ib(dev, port_num)) { + if (rdma_cap_opa_ah(dev, port_num)) + return RDMA_AH_ATTR_TYPE_OPA; return RDMA_AH_ATTR_TYPE_IB; + } + + return RDMA_AH_ATTR_TYPE_UNDEFINED; } =20 /** --=20 2.15.1