From patchwork Sun Jul 3 12:42:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 9211215 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 B516D6048B for ; Sun, 3 Jul 2016 12:43:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4F2628491 for ; Sun, 3 Jul 2016 12:43:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98204286CA; Sun, 3 Jul 2016 12:43:08 +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 E8A3328491 for ; Sun, 3 Jul 2016 12:43:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752541AbcGCMnG (ORCPT ); Sun, 3 Jul 2016 08:43:06 -0400 Received: from mail.kernel.org ([198.145.29.136]:53222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752501AbcGCMnF (ORCPT ); Sun, 3 Jul 2016 08:43:05 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8DBF620259; Sun, 3 Jul 2016 12:43:04 +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 4815B20251; Sun, 3 Jul 2016 12:43:03 +0000 (UTC) From: Leon Romanovsky To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, Talat Batheesh Subject: [PATCH for-next 2/3] IB/core: Fix ib_resolve_eth_dmac for Raw Packet QP Date: Sun, 3 Jul 2016 15:42:06 +0300 Message-Id: <1467549727-23479-3-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 For Raw Packet QP, the AV attribute is passed in INIT to RTR in order to set the Ethernet Priority using the SL. The rest of the fields aren't necessarily valid, which causes the ib_resolve_eth_dmac to fail. Since no release address resolution is needed, don't do anything in ib_resolve_eth_dmac for Raw Packet QP. Fixes: dbf727de7440 ('IB/core: Use GID table in AH creation and ...') Signed-off-by: Talat Batheesh Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index ba75780..d41e403 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1171,7 +1171,7 @@ int ib_resolve_eth_dmac(struct ib_qp *qp, { int ret = 0; - if (*qp_attr_mask & IB_QP_AV) { + if ((*qp_attr_mask & IB_QP_AV) && (qp->qp_type != IB_QPT_RAW_PACKET)) { if (qp_attr->ah_attr.port_num < rdma_start_port(qp->device) || qp_attr->ah_attr.port_num > rdma_end_port(qp->device)) return -EINVAL;