Received: by 10.213.65.68 with SMTP id h4csp2143376imn; Sun, 8 Apr 2018 20:50:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+eLhrlxQt294YnNk+jWD7wrHOZHusOMNzFLlj4hk2GE6l0U5e0vCMJ8++CvXUhnjZC4buQ X-Received: by 2002:a17:902:a701:: with SMTP id w1-v6mr36587005plq.109.1523245810437; Sun, 08 Apr 2018 20:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523245810; cv=none; d=google.com; s=arc-20160816; b=nHo3kEHEYc7QVGgbibn3xA9eExoCE73ErzZ9Yqe4Xwo+1iLRGsttL0mv7lIw5e1yTl SL6jWBPJR7R7MTTcBkBf2FFkk5vaFRmFcHebwCi58SPAhgn3TGl8xb7KuKRnwtd6W03M IJU0xEC4/BkaC6Ca9qJ6CYIooKc/fpSUYYqLzI/vGZERycfoKyCXuSMj5pRVvTsSsXeB sOJ76IIm8IGp7UqUW+DUPVv0mdh0eG/B/HOEzA3wPckkE8LC/gPa/sSRG3uPbE3+pOMa 7uJ1mqVy7q8Z8hdcoZLawg2AU6NHnD3wSVHIoN9VqHoyXc4zzN3ykalwfrpif6gPXPQO x0bQ== 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=PA8C4wbsGJqVqVMnaukWNliNiTWFfj6vG4BFNTNVkac=; b=rvDy24Fvffw2c+lNGb7lFnTuPpA5SLF4tj4a3H5GOhxFtGhAPUQDN5oh/rXUJB0fAq 2cxF0qGdcOpZbyYAo6mK3pinyD9Nt3ROGzWOlsfIWHDF+8kaxGjYXdlCPruAwzny11Nm Ev+q+6g7yGelIgD1a+KpanxqGSJbwfkX/PmMkFDm4JI5Vi8CaSFuQhNHmITvitlxTav3 N2wWaa2YTcA6mixHO/fGArS4YgsPh8DDyz0ctakhjcgXnz7BF/2SjLRJLCxluYsQzwjd lnffjkBYXSTQWwAA7zhGLuFXqTp9XLUMxtighhSK2+/sMnElDlrYzSLdlZzL46AIpoTz 4YDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=crhxuT8x; 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 1-v6si14231309ple.629.2018.04.08.20.49.33; Sun, 08 Apr 2018 20:50: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=crhxuT8x; 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 S1754794AbeDIDom (ORCPT + 99 others); Sun, 8 Apr 2018 23:44:42 -0400 Received: from mail-cys01nam02on0118.outbound.protection.outlook.com ([104.47.37.118]:44776 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754210AbeDIAUU (ORCPT ); Sun, 8 Apr 2018 20:20:20 -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=PA8C4wbsGJqVqVMnaukWNliNiTWFfj6vG4BFNTNVkac=; b=crhxuT8xYPc8RXBqlU8STa/Eth/j5OdKVq51UHFJCdSB/WsrdCYib7T3as5tT6cJzFxV7J/gLr2dQTpjFVubnKtcjToV2lisyplqB46P/zoUVeHkQfJ96qrblWRSTOis0OfmMJUpkVnmkzBpZbcXw/1hI3LBbGRmg/0K3qxBIEU= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1110.namprd21.prod.outlook.com (52.132.131.167) 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:20:13 +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:20:13 +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.15 134/189] IB/core: Map iWarp AH type to undefined in rdma_ah_find_type Thread-Topic: [PATCH AUTOSEL for 4.15 134/189] IB/core: Map iWarp AH type to undefined in rdma_ah_find_type Thread-Index: AQHTz5hMaipE4RP3gkaj7HNpmUp5LA== Date: Mon, 9 Apr 2018 00:18:34 +0000 Message-ID: <20180409001637.162453-134-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-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;DM5PR2101MB1110;7:eF+Kyz43klmAgyrM9haRsiPz1udQmjp/QfE6kTuUG7N+9waIWeJl20SP59ueG+9bmBf5Z+IyVx+echGhyTyZf66ARk9gk+FUoy6MR9WDdS3GjhXyaz+BH1kxroYhfbKoOnTvpqXuA5fw8F9FJHiWH67ojynBOW0pTdPXb4F6qCm2QHG7kIBNwtuolyw/R3d6xIXAlhnmjszebqkUx9PDqVr+ZGu9kx9XNGIDJ98nlg2/bvEkUpwCuV6DkVyuiQ+S;20:jJdyiVbWi0rRpOKmW4/v+f1kGvYpYtb9rOEfga4jAZl4ljjgvX2sEhjjyoTBHDzOOEQvhAeE10nNVZPFtTCfHQfrSryGR6MT/2zzrO6SrXfTSF/gKbG16roTksrlj02sxbqL8HL9iWl/QslZBeYfkwy7vGt7IGjWPyee0F2eiNc= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 31f10f33-fcb4-4367-2c8d-08d59dafa9a0 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1110; x-ms-traffictypediagnostic: DM5PR2101MB1110: 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)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1110;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1110; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(366004)(346002)(396003)(39380400002)(39860400002)(199004)(189003)(5660300001)(478600001)(86612001)(3846002)(6116002)(106356001)(6486002)(72206003)(25786009)(10290500003)(8936002)(6436002)(76176011)(2616005)(6506007)(2900100001)(97736004)(486006)(26005)(36756003)(10090500001)(81166006)(8676002)(81156014)(102836004)(2906002)(99286004)(11346002)(476003)(3660700001)(66066001)(6512007)(575784001)(86362001)(53936002)(105586002)(186003)(5250100002)(14454004)(22452003)(6666003)(2501003)(446003)(7736002)(316002)(1076002)(110136005)(3280700002)(54906003)(68736007)(107886003)(4326008)(305945005)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1110;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: Ftz51Gtrhwy7JgN4lQMDR/mvt38DFkgZL4fsxoTQMKxmNALCckhusGSG89AQ6sID6iaf9zbpSaUKBr6SSCiDvgdhwzliX1qAYwSCRSNBhQ5AjLMNLfCV8mG91Mi1tg1XVuFpJr0b26RX7ZqGsndaouwUyccFpB4FP5y/L8hPRq8qvieReT1q0efrP5yTGxYwmkXscQIhC9FrWIr2T3T74Iz1WlEv+kmKJoDWTNxOD2Vgmy6ffw9LWbcbJ3LdlspLAOZmy5SAWPxG/P1Ze0kRce/eL4a/Uy0A4s34jk7KN+imrsD+iuMZIT1VhwlpjU8kv0A7CFGFvPwwl5r2d1C/3ViKB+fSJkIkRx5+LAIzKCKpSlhY7be7yNrsVLDW1R/XtmJOL66oOfc2KWttnfkxYxvc5CjOq/1bNHCON6ICVZE= 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: 31f10f33-fcb4-4367-2c8d-08d59dafa9a0 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:18:34.7223 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1110 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 20ebf9061962..411776de40e7 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -878,6 +878,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, @@ -3789,17 +3790,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