Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9085027pxu; Mon, 28 Dec 2020 06:16:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAbfGrzrxdireH4aUrsalIpSfZeuirDrHFJdrp5XihFufGGsc3FqfP+b2Hx+oQ/r5WDbeW X-Received: by 2002:a17:907:6e9:: with SMTP id yh9mr41557288ejb.131.1609164976395; Mon, 28 Dec 2020 06:16:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164976; cv=none; d=google.com; s=arc-20160816; b=A16NCkzLm96GV9lujh08MkuayRZXjdrDn2Ro4nczObjtR739Z4feCwfHwIIG2CcAOf qt2arCk2CK/7o+jz6SlOYFNIP0wUFvPEWUO1Ri/SWUJlt8YdxgK8WWaZmd1k/TERGF6T ApK89XAcekO2Cg8ma4Yw8m2mVJiH90tw/unMmmS0JS0S2mkXmR7smy9uBECTHckT/kx1 lcattT5cSjO4UqHBA1mbZJJ/FG0XOmQoRFZir9HsRXi132Ke8gQeZ/g/5PHWwiqH9quQ 0CYQEC7+A7vlmteY+T8vIzGduXIwURZDtlmL2roqKRMeCg11FSz0eVRER06ogv1U99X1 7Clg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0tj/O64/PRvhUcSr2Pj6KJI8g3JzZZaeRhElX2fPPZk=; b=Heym1TvVyszdQVIrMdZ5a8+8TySqdMRhmOnJrVB61oUjRK1zxpxsySs2g10s/FysXk /Age5hYBnEUlYTgYvjByD2lGCqqbQaEITrYQrP1dFrlH1N0zKQn5Ms4+Gk5wKnmpEbe3 nZKH1Gmj6BhR2Bip1VwwGckQOp4XV4hRhCRNYpiggvG9R7NSSuEsipugY1bRRY7U1sOd SkLlKzhT3AMJZSCw59JTwB1vIcRcK8LzDlWpgoa9babVgonfDYPUEztiKLGxVrGzrzlY qtjCoXhoFsPNabqDLggJDoCn787B7gZOrDAQkS4xlr2CJGXTbZyqIfO6SIgsf6vjffr5 XOEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gE+0Cdoy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si20110537edr.464.2020.12.28.06.15.53; Mon, 28 Dec 2020 06:16:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gE+0Cdoy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439507AbgL1OLR (ORCPT + 99 others); Mon, 28 Dec 2020 09:11:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:45022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439139AbgL1OKz (ORCPT ); Mon, 28 Dec 2020 09:10:55 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 33C0B207CC; Mon, 28 Dec 2020 14:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164639; bh=mv87hgKbwt3ZbIdN6Zipbqm2WF/r5TFlQIJ92unKSf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gE+0CdoyWi4+bCXC3HICLjjN2KVs2Sw/uWtqI6AQ5bVdKh3adu24xZOSODa7ntJQI 98E/PvG19T35eXOZrK3pNtQeIa2OFDcROOoEVfMZ93eyDmxUwZjsAsxd8oJpgb+mjr MPhU2QG8DzJVzZL3a4mUgp9FrTWwupVIs2zXP05E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Weihang Li , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.10 215/717] RDMA/hns: Fix missing fields in address vector Date: Mon, 28 Dec 2020 13:43:33 +0100 Message-Id: <20201228125031.275513057@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Weihang Li [ Upstream commit fba429fcf9a5e0c4ec2523ecf4cf18bc0507fcbc ] Traffic class and hop limit in address vector is not assigned from GRH, but it will be filled into UD SQ WQE. So the hardware will get a wrong value. Fixes: 82e620d9c3a0 ("RDMA/hns: Modify the data structure of hns_roce_av") Link: https://lore.kernel.org/r/1605526408-6936-3-git-send-email-liweihang@huawei.com Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hns/hns_roce_ah.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_ah.c b/drivers/infiniband/hw/hns/hns_roce_ah.c index 3be80d42e03a9..d65ff6aa322fa 100644 --- a/drivers/infiniband/hw/hns/hns_roce_ah.c +++ b/drivers/infiniband/hw/hns/hns_roce_ah.c @@ -64,18 +64,20 @@ int hns_roce_create_ah(struct ib_ah *ibah, struct rdma_ah_init_attr *init_attr, struct hns_roce_ah *ah = to_hr_ah(ibah); int ret = 0; - memcpy(ah->av.mac, ah_attr->roce.dmac, ETH_ALEN); - ah->av.port = rdma_ah_get_port_num(ah_attr); ah->av.gid_index = grh->sgid_index; if (rdma_ah_get_static_rate(ah_attr)) ah->av.stat_rate = IB_RATE_10_GBPS; - memcpy(ah->av.dgid, grh->dgid.raw, HNS_ROCE_GID_SIZE); - ah->av.sl = rdma_ah_get_sl(ah_attr); + ah->av.hop_limit = grh->hop_limit; ah->av.flowlabel = grh->flow_label; ah->av.udp_sport = get_ah_udp_sport(ah_attr); + ah->av.sl = rdma_ah_get_sl(ah_attr); + ah->av.tclass = grh->traffic_class; + + memcpy(ah->av.dgid, grh->dgid.raw, HNS_ROCE_GID_SIZE); + memcpy(ah->av.mac, ah_attr->roce.dmac, ETH_ALEN); /* HIP08 needs to record vlan info in Address Vector */ if (hr_dev->pci_dev->revision <= PCI_REVISION_ID_HIP08) { -- 2.27.0