Skip to content

Commit

Permalink
RDMA/hns: Avoid setting loopback indicator when smac is same as dmac
Browse files Browse the repository at this point in the history
[ Upstream commit 3631dad ]

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: d6a3627 ("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 <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Weihang Li authored and gregkh committed Dec 30, 2020
1 parent 6b8a015 commit af7ae24
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions drivers/infiniband/hw/hns/hns_roce_hw_v2.c
Expand Up @@ -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);
Expand All @@ -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 */
Expand Down

0 comments on commit af7ae24

Please sign in to comment.