Received: by 10.192.165.148 with SMTP id m20csp525476imm; Wed, 25 Apr 2018 03:40:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+g0B3Q7nw2hdiB649x4y5pB52Y8zeB5uNi8zvrjmmgzrLQHJcykgrMF7PbLaWv3muEKybK X-Received: by 10.98.210.134 with SMTP id c128mr23595599pfg.240.1524652815544; Wed, 25 Apr 2018 03:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524652815; cv=none; d=google.com; s=arc-20160816; b=EWCOX+ucSxsGMzqhDlYqHYBrfpdFu3D3m8V412qgsM44fMdY5v3PpmrKfzm+wwK+h+ O6wjDTSgu9aXwkQWchV5Je/Hc1FOz7R/rykai0BTa5Hb37cjbQLODNHEZCjlnuzcTrYI vTPRckYA5nh1QC6i0rxTZ0CIs/Gz8h5OObv8uSL21l7ex3870ggAebxvXR1+BrTS13jH xnRbbl7UPHD0SwxDh+4y+55sjwTrDgB5PAwcflrcnpRwHItmmwnr8gadscnIg25ZYCyY +8sJK1viq0+/o8Wc6loauUjgP27kyIFC8IagrKSmvo1GhHabq5Ue1E1cFAhoBHMp/+qC Y5LQ== 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=+/Sy6G9/buQQLlRt/AZnxjmJqHirAeD3KGJb/3LZ4dI=; b=UF1oeImwQ+A2whyTyJ0YQ2xCSsca30JrTMJOmqWXX60e1X6GIUj3YUdq4mvSqNic0t xm082F8pgMGvS3ulzIw9+CJAICqjX1B/7vt+X7HD82izma+wweT+2Qy5/KeAMScK3SPK 6xCWiDqFu+S/Ah8jeDxfJP9Kd/UVhvIYyVT+inTbQegqYsltHBD9q66lRUz48uYAOWGc VBSseyJ9xXJ60MeQnhCrfNMnBPU+1FFFg6XQRxwWEebzfwbivsZPQB7AwCVlRVM5XgRc rzh0PpTlMdzuOnX53dEb1iLbCloYvgOmdHbZp03TmOY2fVYD3a1kTA/fmoAB4yNtGaCl zhFg== 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 m65si15759049pfc.9.2018.04.25.03.40.01; Wed, 25 Apr 2018 03:40:15 -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 S1753329AbeDYKhr (ORCPT + 99 others); Wed, 25 Apr 2018 06:37:47 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51188 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751451AbeDYKhn (ORCPT ); Wed, 25 Apr 2018 06:37:43 -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 56617481; Wed, 25 Apr 2018 10:37:42 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Parav Pandit , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 023/183] RDMA/core: Clarify rdma_ah_find_type Date: Wed, 25 Apr 2018 12:34:03 +0200 Message-Id: <20180425103243.537628810@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: Parav Pandit [ Upstream commit a6532e7139660c103dda181aa5b2c734aa26ed6c ] iWARP does not use rdma_ah_attr_type, and for this reason we do not have a RDMA_AH_ATTR_TYPE_IWARP. rdma_ah_find_type should not even be called on iwarp ports and for clarity it shouldn't have a special test for iWarp. This changes the result from RDMA_AH_ATTR_TYPE_ROCE to RDMA_AH_ATTR_TYPE_IB when wrongly called on an iWarp port. Fixes: 44c58487d51a ("IB/core: Define 'ib' and 'roce' rdma_ah_attr types") Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- include/rdma/ib_verbs.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -3766,8 +3766,7 @@ static inline void rdma_ah_set_grh(struc static inline enum rdma_ah_attr_type rdma_ah_find_type(struct ib_device *dev, u32 port_num) { - if ((rdma_protocol_roce(dev, port_num)) || - (rdma_protocol_iwarp(dev, 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)))