Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2332130imm; Mon, 28 May 2018 06:13:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqj/9wWGgFCHd1ibXbpC+J7o+Xwz0FslEpL75KeRBcz5Cwm53en5UbRTCCyi6WO9Bc9joIo X-Received: by 2002:a62:850f:: with SMTP id u15-v6mr13418351pfd.160.1527513192745; Mon, 28 May 2018 06:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527513192; cv=none; d=google.com; s=arc-20160816; b=KEs4UY3qo9N6DL+wgxmSyTacGeCS5kFpid36k0zNn4+KBnAgzooCutvDJsdWi3Nkxi ySJ+8/mx7mA22bsV2vpj6xG4D4nl6D1w+1fATEdv0YIPWxOVK9GrAn25HAqtS2RSWAM2 gUrPaN4rDjEoV8PXv4YBk4vN+KKVpBal8LbtjWbgu5IunWgi5lN2yEh9uurM+WHK/ecp viCB+em/gqaHGGt1jSvCyNqpPcZ/PFs2pGK5O/gkqqVNt+Ojbrnl640SjxRy8a+8LC75 c/lpnm+CeV7fBj0rXiEnNAcuyWDZ460tA/XVhnZ38Rm7ewMsFIvy5sJW7fPrK86eRgYU +TmQ== 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:dkim-signature :arc-authentication-results; bh=CZJmb5Bg8GW2Q9RjQyFEtmv6mqB7CxDgyFtJdT4VbS4=; b=V4B28DGA06dveOCxVnje4jRRTxa55izN4ycP1o/80ciVmbuahx4a3hr/6HQGl29+ol Qxib3LjoOubdxYGadtyVMB9Rod6tE4smkkvZPNWQFKM/+WyBbwpmCnNbmS96A38YFERZ nJqX+pO32vx119a/YPV8RQmDbVfNUw3sVmkA3ftoIc6CaH23TirjYkQ/AW4dQNqutCpw yCl2aMuiem53sJmmbYVyE4Jgw1wa0qZqsYwTekQv4K8ePBWfP0BIJ22vTCRRPtC0sfB3 usX2kHZmmUjeGa9REst7PIQD7ltLLWa5rDqBaBEMRfVrmlO56KPAqjyN8+UFuaGfZyu/ na4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Oxfvo+xo; 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 b7-v6si22627919pgn.583.2018.05.28.06.12.57; Mon, 28 May 2018 06:13:12 -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=@kernel.org header.s=default header.b=Oxfvo+xo; 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 S1163747AbeE1Ku4 (ORCPT + 99 others); Mon, 28 May 2018 06:50:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:40318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163737AbeE1Kut (ORCPT ); Mon, 28 May 2018 06:50:49 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8A47520660; Mon, 28 May 2018 10:50:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504648; bh=5MzU4dH9SoS0mEI0h1wDh3xQ5h0q+vrmbeCh/8snhE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oxfvo+xoNktCM3Dx1JO1BbU6q7XjGo0fRJt5fs0IW293pmmnQtK36eB29HK0Tl31K Zl7ERp+Ncm8BMP83yJn63GZh+mjKi5PYs2FogzXH3KAFeMWNOyziBtrKEczJR3RCjJ pK3WRmZBBMqfvm7tTAnJMxBXeUGmdurjMRS9mgyQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Majd Dibbiny , Moni Shoua , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 182/496] IB/mlx: Set slid to zero in Ethernet completion struct Date: Mon, 28 May 2018 11:59:27 +0200 Message-Id: <20180528100327.628551595@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@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: Moni Shoua [ Upstream commit 65389322b28f81cc137b60a41044c2d958a7b950 ] IB spec says that a lid should be ignored when link layer is Ethernet, for example when building or parsing a CM request message (CA17-34). However, since ib_lid_be16() and ib_lid_cpu16() validates the slid, not only when link layer is IB, we set the slid to zero to prevent false warnings in the kernel log. Fixes: 62ede7779904 ("Add OPA extended LID support") Reviewed-by: Majd Dibbiny Signed-off-by: Moni Shoua Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/mlx4/cq.c | 4 +++- drivers/infiniband/hw/mlx5/cq.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) --- a/drivers/infiniband/hw/mlx4/cq.c +++ b/drivers/infiniband/hw/mlx4/cq.c @@ -597,6 +597,7 @@ static void use_tunnel_data(struct mlx4_ wc->dlid_path_bits = 0; if (is_eth) { + wc->slid = 0; wc->vlan_id = be16_to_cpu(hdr->tun.sl_vid); memcpy(&(wc->smac[0]), (char *)&hdr->tun.mac_31_0, 4); memcpy(&(wc->smac[4]), (char *)&hdr->tun.slid_mac_47_32, 2); @@ -845,7 +846,6 @@ repoll: } } - wc->slid = be16_to_cpu(cqe->rlid); g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn); wc->src_qp = g_mlpath_rqpn & 0xffffff; wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f; @@ -854,6 +854,7 @@ repoll: wc->wc_flags |= mlx4_ib_ipoib_csum_ok(cqe->status, cqe->checksum) ? IB_WC_IP_CSUM_OK : 0; if (is_eth) { + wc->slid = 0; wc->sl = be16_to_cpu(cqe->sl_vid) >> 13; if (be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_CVLAN_PRESENT_MASK) { @@ -865,6 +866,7 @@ repoll: memcpy(wc->smac, cqe->smac, ETH_ALEN); wc->wc_flags |= (IB_WC_WITH_VLAN | IB_WC_WITH_SMAC); } else { + wc->slid = be16_to_cpu(cqe->rlid); wc->sl = be16_to_cpu(cqe->sl_vid) >> 12; wc->vlan_id = 0xffff; } --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c @@ -224,7 +224,6 @@ static void handle_responder(struct ib_w wc->ex.invalidate_rkey = be32_to_cpu(cqe->imm_inval_pkey); break; } - wc->slid = be16_to_cpu(cqe->slid); wc->src_qp = be32_to_cpu(cqe->flags_rqpn) & 0xffffff; wc->dlid_path_bits = cqe->ml_path; g = (be32_to_cpu(cqe->flags_rqpn) >> 28) & 3; @@ -239,10 +238,12 @@ static void handle_responder(struct ib_w } if (ll != IB_LINK_LAYER_ETHERNET) { + wc->slid = be16_to_cpu(cqe->slid); wc->sl = (be32_to_cpu(cqe->flags_rqpn) >> 24) & 0xf; return; } + wc->slid = 0; vlan_present = cqe->l4_l3_hdr_type & 0x1; roce_packet_type = (be32_to_cpu(cqe->flags_rqpn) >> 24) & 0x3; if (vlan_present) {