Received: by 10.192.165.148 with SMTP id m20csp548630imm; Wed, 25 Apr 2018 04:05:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/9eej4IlhIOd73P7eX96SWQvDFCML8NWS6APx8EFkzQD+lC0bvD2WpJTZMq2sp0Z6TUTqi X-Received: by 2002:a17:902:680e:: with SMTP id h14-v6mr28155823plk.90.1524654327881; Wed, 25 Apr 2018 04:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524654327; cv=none; d=google.com; s=arc-20160816; b=SMFK4jfhxI8EueyQOXSqbvusFI3obCN1neWyfEhuxonm0ZFLs6Dkl3YEn+cOp3J5AL 8SPv/9jM36tgENxLXksW86Wm51zIOSg6buP8sraRkDgOfASQHUpnUIKM4ZzVMv/XMolB Cm02fsk7qeU1VKMChb9msSF9YA4bzG0+5eaKUL6y1OJshFAVA0gs9bQTO7Xt2H1zXBip u8Ooy0AqDEMWeGx7DwhByQGQU8L9515G0PjtKmXISxpa/KtSd+pmTyxvlbm3H9qBDVvN eyVtxspRS6yDwj/AzeAcFSwTQyFDeOuzrml0DpqSYNz6h/+eECSJgys2yB4jHeeslO6J OpcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=9E7FSr4XBdRtkpi6//J5ZVQb2Hdd04S6xoUTabgDRWI=; b=1A9kE0kuB7J7UIMEdLNltUqbic5f7N0twCHPvO/Cc4PMAz0VxEu90I0XZSs+owKRhn rvyl/+/6wzR/yVVlgiluNY1Iu8+cAGw+fqKEyP8D6LDix0Z41V8oQbUE2SaQJCtRBvls xJTaWmeELPKen57kW1cqYVl81Z2te6fkSp0aAuGJqOUkX4S6JLZlRXk0gRr+If3O+sKc LnBhzaF4aNfgDoJFaRPWxXw/HAS1Mjs+m+iFvGe8sW96iQHYYrkLvfipB2J1YgdC4gxK m7TAC6QUlJ4Cnrc/UYxLxuKDxaDnA+f0hemD9NOXyUNCbk0C3Qf557P3WwB5Rz0ypAIF XbGw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n30si13701840pgc.231.2018.04.25.04.05.13; Wed, 25 Apr 2018 04:05:27 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754236AbeDYLEM (ORCPT + 99 others); Wed, 25 Apr 2018 07:04:12 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52580 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753092AbeDYKmM (ORCPT ); Wed, 25 Apr 2018 06:42:12 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1E63336; Wed, 25 Apr 2018 10:42:11 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Parav Pandit , Sean Hefty , Ira Weiny , Shiraz Saleem , Don Hiatt , Dennis Dalessandro , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 123/183] IB/core: Map iWarp AH type to undefined in rdma_ah_find_type Date: Wed, 25 Apr 2018 12:35:43 +0200 Message-Id: <20180425103247.376479953@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- include/rdma/ib_verbs.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) --- 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); 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(struc grh->traffic_class = traffic_class; } -/*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 *dev, - 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; } /**