From patchwork Sun Jul 3 12:42:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 9211217 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2F6D96048B for ; Sun, 3 Jul 2016 12:43:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2013628491 for ; Sun, 3 Jul 2016 12:43:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14B45286CA; Sun, 3 Jul 2016 12:43:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89A7628491 for ; Sun, 3 Jul 2016 12:43:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752544AbcGCMnW (ORCPT ); Sun, 3 Jul 2016 08:43:22 -0400 Received: from mail.kernel.org ([198.145.29.136]:53244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752501AbcGCMnW (ORCPT ); Sun, 3 Jul 2016 08:43:22 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 56BBF20259; Sun, 3 Jul 2016 12:43:21 +0000 (UTC) Received: from localhost (unknown [193.47.165.251]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EA73820251; Sun, 3 Jul 2016 12:43:19 +0000 (UTC) From: Leon Romanovsky To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, Talat Batheesh Subject: [PATCH for-next 3/3] IB/mlx5: Fix mlx5_set_path for Raw Packet QP Date: Sun, 3 Jul 2016 15:42:07 +0300 Message-Id: <1467549727-23479-4-git-send-email-leon@kernel.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1467549727-23479-1-git-send-email-leon@kernel.org> References: <1467549727-23479-1-git-send-email-leon@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Talat Batheesh mlx5_set_path returns error when called without GRH in Ethernet link layer. Since this is not mandatory for Raw Packet QP, it shouldn't fail in this case. Added additional check of QP type to make the decision. Fixes: 2811ba51b049 ('IB/mlx5: Add RoCE fields to Address Vector') Signed-off-by: Talat Batheesh Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/qp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index e9b3a1f..fbd94a9 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -2175,7 +2175,8 @@ static int mlx5_set_path(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, } if (ll == IB_LINK_LAYER_ETHERNET) { - if (!(ah->ah_flags & IB_AH_GRH)) + if (!(ah->ah_flags & IB_AH_GRH) && + (qp->ibqp.qp_type != IB_QPT_RAW_PACKET)) return -EINVAL; memcpy(path->rmac, ah->dmac, sizeof(ah->dmac)); path->udp_sport = mlx5_get_roce_udp_sport(dev, port,