Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9083280pxu; Mon, 28 Dec 2020 06:13:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNHhle1t3LffXnPvt8CjGcTROmdQaul/AkChSuF6jyM3XpwkwzX3LWAdoYyKpTrfawsB/W X-Received: by 2002:a17:906:73d8:: with SMTP id n24mr41180151ejl.14.1609164837919; Mon, 28 Dec 2020 06:13:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164837; cv=none; d=google.com; s=arc-20160816; b=HL7feC4s6/zRYU0kEu0l/Cf3ltXt128gvqT40qfLJm5HWELgMMfi+2VfHmmOiVQ6ST ZHjt78qN7yQMfq3XtPxHKYjv4Yg9Ld2zhdvq8XHIR6zmc8h56y8nFF224tZBRkg8qmXm HRfG8+FVt7vyDEeZxfJ4e+fZXyqiH0tIGFp+jiTxpVF3wE8HdYogPFmNVlOTbuGPPTXc ydATr87wOzqGW4pNeiVZUYZAODldfyndDKGT/PpyQVVJ0ZBIKCYIxnscKO84tt7clJgg qb+aTyN90/gSBIviByLy1g5vBucQD5xUCUjy4C3bzjsddv2MYOZShFMhVWgZFVhha8ba 2bWw== 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=Qc+XzmQmcw2vqqKp3l4MVPGG+PVhiAp4KxeX/wYco/k=; b=hMTevXyX+0AVJ83heRcJXe4r18bHbCpdDK49vMSlsOmEctN6qkXmPCYrU35Ehw0pN8 Fbvdw7Yim5JOncgkFCDwzbkVx0TyOwZYiG14kK22ziVYPnTpa6l9nxC0g/IQk1SRB46I 0Es1rAs06iHkqjBmUi1sFUZj5u8Vkw2JjFTsR3qXJvjqZak/nnjKgCjyMdKDCpMwOEq0 j6V23AJDrx5ybgHmx7qFFBj4kPzILEsb2i4cQtJ3d+awdTgYkEQSKrcUuY0/etDFXRkQ K510cxP8cVCwqdIuL+Uk0VS2FwiEZ5xWJ9IKzKVDY60HWA4rCiPQKkXhI0TieYHPsFQ1 AwCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Nddhm28V; 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 m12si18048248ejr.608.2020.12.28.06.13.34; Mon, 28 Dec 2020 06:13:57 -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=Nddhm28V; 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 S2439671AbgL1OL3 (ORCPT + 99 others); Mon, 28 Dec 2020 09:11:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:46010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439608AbgL1OLX (ORCPT ); Mon, 28 Dec 2020 09:11:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id F249620791; Mon, 28 Dec 2020 14:10:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164642; bh=BqJwRxP8ZzfzyNkfWQlO8MWhnedBFyBNcvCiWPOYyBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nddhm28VF61Y3VZ9+knXiJmixHBcLQ1ZD+88o/51XCLpNbpLqdYvdLxji9VplHi74 TAubaxBcWHIzIRjZ4XVna0pHaPMHiqGDYds5q12jnMO36dKuPgNraq818AYcuBf/0Q UdwAOYZea0oRrefOh+Z/H8fIYHmdGsivuRyfR0PE= 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 216/717] RDMA/hns: Avoid setting loopback indicator when smac is same as dmac Date: Mon, 28 Dec 2020 13:43:34 +0100 Message-Id: <20201228125031.325146544@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 3631dadfb118821236098a215e59fb5d3e1c30a8 ] The loopback flag will be set to 1 by the hardware when the source mac address is same as the destination mac address. So the driver don't need to compare them. Fixes: d6a3627e311c ("RDMA/hns: Optimize wqe buffer set flow for post send") Link: https://lore.kernel.org/r/1605526408-6936-4-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_hw_v2.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index d127e0e4c3cda..4db7eea3dcec5 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -433,8 +433,6 @@ static inline int set_ud_wqe(struct hns_roce_qp *qp, unsigned int curr_idx = *sge_idx; int valid_num_sge; u32 msg_len = 0; - bool loopback; - u8 *smac; int ret; valid_num_sge = calc_wr_sge_num(wr, &msg_len); @@ -457,13 +455,6 @@ static inline int set_ud_wqe(struct hns_roce_qp *qp, roce_set_field(ud_sq_wqe->byte_48, V2_UD_SEND_WQE_BYTE_48_DMAC_5_M, V2_UD_SEND_WQE_BYTE_48_DMAC_5_S, ah->av.mac[5]); - /* MAC loopback */ - smac = (u8 *)hr_dev->dev_addr[qp->port]; - loopback = ether_addr_equal_unaligned(ah->av.mac, smac) ? 1 : 0; - - roce_set_bit(ud_sq_wqe->byte_40, - V2_UD_SEND_WQE_BYTE_40_LBI_S, loopback); - ud_sq_wqe->msg_len = cpu_to_le32(msg_len); /* Set sig attr */ -- 2.27.0